Compare commits

..

18 Commits

Author SHA1 Message Date
014170989e Merge branch 'fix-prototypage-details' into deploy/quick-fixes 2021-06-29 15:21:00 +02:00
c26d342d30 [TO REVERSE] enlève menu activités 2021-06-29 00:19:57 +02:00
2cf28b6c2d fix in accompanying period list: thirdparty as requestor + link 2021-06-29 00:03:24 +02:00
ed5351da14 fix missing div in accompanying course work list 2021-06-28 23:48:06 +02:00
8dca8d9b37 Merge branch 'features/api-search' into deploy/quick-fixes 2021-06-28 23:21:36 +02:00
1cddad5c66 Merge remote-tracking branch 'origin/fix_issues_juminet' into deploy/quick-fixes 2021-06-28 23:09:22 +02:00
c98eda93cf Merge remote-tracking branch 'origin/fix-prototypage-details' into deploy/quick-fixes 2021-06-28 23:09:07 +02:00
357bf192b8 Merge branch 'features/add-suggestion-household-member-editor' into deploy/quick-fixes 2021-06-28 16:22:36 +02:00
efefb64119 Merge branch 'features/add-suggestion-household-member-editor' into deploy/quick-fixes 2021-06-28 15:51:37 +02:00
6fa882f60f Merge remote-tracking branch 'origin/fix_issues_juminet' into deploy/quick-fixes 2021-06-28 15:50:10 +02:00
484058dcfc Merge remote-tracking branch 'origin/master' into deploy/quick-fixes 2021-06-28 15:48:59 +02:00
b7513068da Merge branch 'features/edit-accompanying-period-social-work' into deploy/quick-fixes 2021-06-25 15:01:46 +02:00
2dd71ea197 Merge remote-tracking branch 'origin/master' into deploy/quick-fixes 2021-06-25 15:00:24 +02:00
757c064b7b form acc work edit: save action 2021-06-25 00:05:27 +02:00
f5d38f606c Merge remote-tracking branch 'origin/fix_small_issues_juminet' into deploy/quick-fixes 2021-06-24 16:31:32 +02:00
5abe482b12 Merge remote-tracking branch 'origin/fix-prototypage-details' into deploy/quick-fixes 2021-06-24 16:30:50 +02:00
5ded4822a2 Merge branch 'features/edit-accompanying-period-social-work' into deploy/quick-fixes 2021-06-24 16:28:23 +02:00
6122a5d62f Merge remote-tracking branch 'origin/fix-prototypage-details' into deploy/quick-fixes 2021-06-23 10:30:33 +02:00
47 changed files with 495 additions and 783 deletions

View File

@@ -72,7 +72,6 @@ class ActivityController extends AbstractController
{
$em = $this->getDoctrine()->getManager();
$view = null;
// TODO: add pagination
[$person, $accompanyingPeriod] = $this->getEntity($request);
@@ -81,9 +80,10 @@ class ActivityController extends AbstractController
->getReachableCircles($this->getUser(), new Role('CHILL_ACTIVITY_SEE'),
$person->getCenter());
$activities = $em->getRepository(Activity::class)
->findByPersonImplied($person, $reachableScopes)
;
$activities = $em->getRepository('ChillActivityBundle:Activity')->findBy(
['person' => $person, 'scope' => $reachableScopes],
['date' => 'DESC'],
);
$event = new PrivacyEvent($person, array(
'element_class' => Activity::class,

View File

@@ -224,8 +224,7 @@ class ActivityType extends AbstractType
if ($activityType->isVisible('comment')) {
$builder->add('comment', CommentType::class, [
'label' => empty($activityType->getLabel('comment'))
? 'activity.comment' : $activityType->getLabel('comment'),
'label' => $activityType->getLabel('comment'),
'required' => $activityType->isRequired('comment'),
]);
}

View File

@@ -0,0 +1,88 @@
<?php
/*
*
*/
namespace Chill\ActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Translation\TranslatorInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Role\Role;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter;
/**
*
*
* @author Julien Fastré <julien.fastre@champs-libres.coop>
*/
class MenuBuilder implements LocalMenuBuilderInterface
{
/**
*
* @var TokenStorageInterface
*/
protected $tokenStorage;
/**
*
* @var TranslatorInterface
*/
protected $translator;
/**
*
* @var AuthorizationHelper
*/
protected $authorizationHelper;
public function __construct(
TokenStorageInterface $tokenStorage,
TranslatorInterface $translator,
AuthorizationHelper $authorizationHelper
) {
$this->tokenStorage = $tokenStorage;
$this->translator = $translator;
$this->authorizationHelper = $authorizationHelper;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
/* @var $person \Chill\PersonBundle\Entity\Person */
$person = $parameters['person'];
$user = $this->tokenStorage->getToken()->getUser();
$roleSee = new Role(ActivityVoter::SEE);
$roleAdd = new Role(ActivityVoter::CREATE);
if ($this->authorizationHelper->userHasAccess($user, $person, $roleSee)) {
$menu->addChild($this->translator->trans('Activity list'), [
'route' => 'chill_activity_activity_list',
'routeParameters' => [
'person_id' => $person->getId()
]
])
->setExtras([
'order' => 201
]);
}
if ($this->authorizationHelper->userHasAccess($user, $person, $roleAdd)) {
$menu->addChild($this->translator->trans('Add a new activity'), [
'route' => 'chill_activity_activity_new',
'routeParameters' => [
'person_id' => $person->getId()
]
])
->setExtras([
'order' => 200
]);
}
}
public static function getMenuIds(): array
{
return [ 'person' ];
}
}

View File

@@ -15,7 +15,8 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Chill\ActivityBundle\Menu;
namespace Chill\ActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
@@ -54,15 +55,26 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
{
/* @var $person \Chill\PersonBundle\Entity\Person */
$person = $parameters['person'];
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
$menu->addChild(
$this->translator->trans('Activity list'), [
'route' => 'chill_activity_activity_list',
'routeParameters' => [ 'person_id' => $person->getId() ],
])
->setExtra('order', 201)
;
if (false) {
if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) {
$menu->addChild(
$this->translator->trans('Activity list'), [
'route' => 'chill_activity_activity_list',
'routeParameters' => [ 'person_id' => $person->getId() ],
])
->setExtra('order', 201)
;
}
if ($this->authorizationChecker->isGranted(ActivityVoter::CREATE, $person)) {
$menu->addChild(
$this->translator->trans('Add a new activity'), [
'route' => 'chill_activity_activity_new',
'routeParameters' => [ 'person_id' => $person->getId() ],
])
->setExtra('order', 200)
;
}
}
}

View File

@@ -38,30 +38,5 @@ class ActivityRepository extends ServiceEntityRepository
{
parent::__construct($registry, Activity::class);
}
public function findByPersonImplied($person, array $scopes, $orderBy = [ 'date' => 'DESC'], $limit = 100, $offset = 0)
{
$qb = $this->createQueryBuilder('a');
$qb->select('a');
$qb
// TODO add acl
//->where($qb->expr()->in('a.scope', ':scopes'))
//->setParameter('scopes', $scopes)
->andWhere(
$qb->expr()->orX(
$qb->expr()->eq('a.person', ':person'),
':person MEMBER OF a.persons'
)
)
->setParameter('person', $person)
;
foreach ($orderBy as $k => $dir) {
$qb->addOrderBy('a.'.$k, $dir);
}
return $qb->getQuery()
->getResult();
}
}

View File

@@ -99,7 +99,7 @@
</a>
</li>
<li>
<button class="sc-button bt-update" type="submit">{{ 'Save'|trans }}</button>
<button class="sc-button bt-update" type="submit">{{ 'Save activity'|trans }}</button>
</li>
</ul>
{{ form_end(edit_form) }}

View File

@@ -10,7 +10,6 @@
{% endblock %}
{% block js %}
{{ parent() }}
{{ encore_entry_link_tags('async_upload') }}
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) {
@@ -23,7 +22,6 @@
{% endblock %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('async_upload') }}
{{ encore_entry_link_tags('vue_activity') }}
{% endblock %}

View File

@@ -17,7 +17,7 @@
</p>
{% else %}
<div class="flex-table list-records context-{{ context }}">
<div class="flex-table list-records {{ context }}">
<!--
<thead>
<tr>
@@ -54,20 +54,6 @@
</p>
{% endif %}
</div>
{% if context == 'person' and activity.accompanyingPeriod is not empty %}
<div class="accompanyingPeriodLink" style="margin-top: 1rem">
<a
href="{{ chill_path_add_return_path(
"chill_person_accompanying_course_index",
{ 'accompanying_period_id': activity.accompanyingPeriod.id }
) }}"
>
<i class="fa fa-random"></i>
{{ activity.accompanyingPeriod.id }}
</a>
</div>
{% endif %}
</div>
<div class="item-col">
@@ -161,14 +147,13 @@
</div>
{%
if activity.comment.comment is not empty
if activity.comment.comment is not empty
or activity.persons|length > 0
or activity.thirdParties|length > 0
or activity.users|length > 0
%}
<div class="item-row details">
<div class="item-col">
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'with_display': 'row', 'entity': activity } %}
</div>
@@ -185,13 +170,10 @@
</div>
{% endif %}
{% if context != 'person' %}
{# TODO set this condition in configuration #}
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" class="sc-button bt-create">
{{ 'Add a new activity' | trans }}
</a>
</li>
</ul>
{% endif %}
<ul class="record_actions">
<li>
<a href="{{ path('chill_activity_activity_new', {'person_id': person_id, 'accompanying_period_id': accompanying_course_id}) }}" class="sc-button bt-create">
{{ 'Add a new activity' | trans }}
</a>
</li>
</ul>

View File

@@ -98,7 +98,7 @@
</li>
<li>
<button class="sc-button bt-create" type="submit">
{{ 'Create'|trans }}
{{ 'Add a new activity'|trans }}
</button>
</li>
</ul>

View File

@@ -10,7 +10,6 @@
{% endblock %}
{% block js %}
{{ parent() }}
{{ encore_entry_script_tags('async_upload') }}
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', function (e) {
@@ -23,7 +22,6 @@
{% endblock %}
{% block css %}
{{ parent() }}
<link rel="stylesheet" href="{{ asset('build/async_upload.css') }}"/>
{{ encore_entry_link_tags('vue_activity') }}
{% endblock %}

View File

@@ -117,7 +117,7 @@
</li>
<li>
<a class="sc-button bt-update" href="{{ path('chill_activity_activity_edit', { 'id': entity.id, 'person_id': person_id, 'accompanying_period_id': accompanying_course_id }) }}">
{{ 'Edit'|trans }}
{{ 'Edit the activity'|trans }}
</a>
</li>
{# TODO

View File

@@ -74,7 +74,6 @@ Users concerned: T(M)S
activity:
Insert a document: Insérer un document
Remove a document: Supprimer le document
comment: Commentaire
#timeline

View File

@@ -1,27 +0,0 @@
<?php
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
class UserApiController extends ApiController
{
/**
* @Route(
* "/api/1.0/main/whoami.{_format}",
* name="chill_main_user_whoami",
* requirements={
* "_format": "json"
* }
* )
*/
public function whoami($_format): JsonResponse
{
return $this->json($this->getUser(), JsonResponse::HTTP_OK, [],
[ "groups" => [ "read" ] ]);
}
}

View File

@@ -347,28 +347,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
]
],
]
],
[
'class' => \Chill\MainBundle\Entity\User::class,
'controller' => \Chill\MainBundle\Controller\UserApiController::class,
'name' => 'user',
'base_path' => '/api/1.0/main/user',
'base_role' => 'ROLE_USER',
'actions' => [
'_index' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true
],
],
'_entity' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
]
],
]
],
]
]
]);
}

View File

@@ -45,8 +45,7 @@ class CommentType extends AbstractType
{
$builder
->add('comment', ChillTextareaType::class, [
'disable_editor' => $options['disable_editor'],
'label' => $options['label'],
'disable_editor' => $options['disable_editor']
])
;

View File

@@ -35,7 +35,6 @@ $table-body-td-text-align: left;
// Tabs
$tabs-nav-margin-bottom: 0.2em;
$tabs-nav-bg-color: $yellow;
$tabs-nav-bg-color-light: lighten($yellow, 10%);
$tabs-nav-text-color: $blue;
$tabs-new-border: none;
$tabs-nav-hover-border: none;

View File

@@ -26,13 +26,7 @@ $global-bg-color: $yellow;
color: $tabs-nav-title-text-color;
}
&.sub-menu {
padding-left: 20px;
> a {
background-color: $tabs-nav-bg-color-light;
}
}
> a {
> a {
display: block;
width: auto;
padding: $tabs-nav-padding;
@@ -44,11 +38,11 @@ $global-bg-color: $yellow;
@include border-top-radius($base-border-radius);
@include border-bottom-radius($base-border-radius);
&:hover, &:active {
&:hover, &:active {
border: $tabs-nav-hover-border;
color: $tabs-nav-hover-text-color;
text-decoration: none;
}
}
}
}
}

View File

@@ -46,7 +46,6 @@
<city-selection
v-bind:address="address"
v-bind:focusOnAddress="focusOnAddress"
v-bind:getReferenceAddresses="getReferenceAddresses">
</city-selection>
@@ -174,14 +173,6 @@ export default {
// this.$refs.search.focus(); // positionner le curseur à l'ouverture de la modale
//})
},
focusOnCity() {
const citySelector = document.getElementById('citySelector');
citySelector.focus();
},
focusOnAddress() {
const addressSelector = document.getElementById('addressSelector');
addressSelector.focus();
},
getCountries() {
console.log('getCountries');
this.loading = true;

View File

@@ -1,7 +1,6 @@
<template>
<div class="container">
<VueMultiselect
id="addressSelector"
v-model="value"
@select="selectAddress"
name="field"
@@ -71,7 +70,7 @@ export default {
},
methods: {
transName(value) {
return value.streetNumber === undefined ? value.street : `${value.streetNumber}, ${value.street}`
return value.streetNumber === undefined ? value.street : `${value.street}, ${value.streetNumber}`
},
selectAddress(value) {
this.address.selected.address = value;

View File

@@ -1,7 +1,6 @@
<template>
<div class="container">
<VueMultiselect
id="citySelector"
v-model="value"
@select="selectCity"
name="field"
@@ -36,7 +35,7 @@ import VueMultiselect from 'vue-multiselect';
export default {
name: 'CitySelection',
components: { VueMultiselect },
props: ['address', 'getReferenceAddresses', 'focusOnAddress'],
props: ['address', 'getReferenceAddresses'],
data() {
return {
value: null
@@ -75,7 +74,6 @@ export default {
this.address.newPostalCode.name = value.name;
this.address.newPostalCode.code = value.code;
this.getReferenceAddresses(value);
this.focusOnAddress();
},
addPostalCode() {
this.address.writeNewPostalCode = true;

View File

@@ -40,6 +40,7 @@ export default {
return name.fr //TODO multilang
},
selectCountry(value) {
console.log(value);
this.address.selected.country = value;
this.getCities(value);
},

View File

@@ -14,7 +14,7 @@ class AddressNormalizer implements NormalizerAwareInterface, NormalizerInterface
public function normalize($address, string $format = null, array $context = [])
{
$data['address_id'] = $address->getId();
$data['text'] = $address->isNoAddress() ? '' : $address->getStreetNumber().', '.$address->getStreet();
$data['text'] = $address->isNoAddress() ? '' : $address->getStreet().', '.$address->getStreetNumber();
$data['street'] = $address->getStreet();
$data['streetNumber'] = $address->getStreetNumber();
$data['postcode']['name'] = $address->getPostCode()->getName();

View File

@@ -1,49 +0,0 @@
<?php
namespace Chill\MainBundle\Tests\Controller;
use Chill\MainBundle\Test\PrepareClientTrait;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class UserApiControllerTest extends WebTestCase
{
use PrepareClientTrait;
public function testIndex()
{
$client = $this->getClientAuthenticated();
$client->request(Request::METHOD_GET, '/api/1.0/main/user.json');
$this->assertResponseIsSuccessful();
$data = \json_decode($client->getResponse()->getContent(), true);
$this->assertTrue(\array_key_exists('count', $data));
$this->assertGreaterThan(0, $data['count']);
$this->assertTrue(\array_key_exists('results', $data));
return $data['results'][0];
}
/**
* @depends testIndex
*/
public function testEntity($existingUser)
{
$client = $this->getClientAuthenticated();
$client->request(Request::METHOD_GET, '/api/1.0/main/user/'.$existingUser['id'].'.json');
$this->assertResponseIsSuccessful();
}
public function testWhoami()
{
$client = $this->getClientAuthenticated();
$client->request(Request::METHOD_GET, '/api/1.0/main/whoami.json');
$this->assertResponseIsSuccessful();
}
}

View File

@@ -10,19 +10,6 @@ servers:
components:
schemas:
User:
type: object
properties:
id:
type: integer
type:
type: string
enum:
- user
username:
type: string
text:
type: string
Center:
type: object
properties:
@@ -438,46 +425,3 @@ paths:
description: "not found"
401:
description: "Unauthorized"
/1.0/main/user.json:
get:
tags:
- user
summary: Return a list of all user
responses:
200:
description: "ok"
/1.0/main/whoami.json:
get:
tags:
- user
summary: Return the currently authenticated user
responses:
200:
description: "ok"
/1.0/main/user/{id}.json:
get:
tags:
- user
summary: Return a user by id
parameters:
- name: id
in: path
required: true
description: The user id
schema:
type: integer
format: integer
minimum: 1
responses:
200:
description: "ok"
content:
application/json:
schema:
$ref: '#/components/schemas/User'
404:
description: "not found"
401:
description: "Unauthorized"

View File

@@ -30,7 +30,7 @@ class HouseholdController extends AbstractController
$this->translator = $translator;
$this->positionRepository = $positionRepository;
}
/**
* @Route(
* "/{household_id}/summary",
@@ -47,7 +47,7 @@ class HouseholdController extends AbstractController
->findByActiveOrdered()
;
// little performance improvement:
// little performance improvement:
// initialize members collection, which will avoid
// some queries
$household->getMembers()->initialize();
@@ -67,31 +67,6 @@ class HouseholdController extends AbstractController
);
}
/**
* @Route(
* "/{household_id}/accompanying-period",
* name="chill_person_household_accompanying_period",
* methods={"GET", "HEAD"}
* )
* @ParamConverter("household", options={"id" = "household_id"})
*/
public function accompanyingPeriod(Request $request, Household $household)
{
// TODO ACL
$members = $household->getMembers();
foreach($members as $m) {
$accompanyingPeriods = $m->getPerson()->getAccompanyingPeriods();
}
return $this->render('@ChillPerson/Household/accompanying_period.html.twig',
[
'household' => $household,
'accompanying_periods' => $accompanyingPeriods
]
);
}
/**
* @Route(
* "/{household_id}/addresses",

View File

@@ -9,22 +9,22 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class HouseholdMenuBuilder implements LocalMenuBuilderInterface
{
/**
* @var TranslatorInterface
*/
protected $translator;
public function __construct(TranslatorInterface $translator)
{
$this->translator = $translator;
}
public static function getMenuIds(): array
{
return [ 'household' ];
}
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
{
$household = $parameters['household'];
@@ -35,22 +35,15 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface
'household_id' => $household->getId()
]])
->setExtras(['order' => 10]);
$menu->addChild($this->translator->trans('household.Accompanying period'), [
'route' => 'chill_person_household_accompanying_period',
'routeParameters' => [
'household_id' => $household->getId()
]])
->setExtras(['order' => 20]);
$menu->addChild($this->translator->trans('household.Addresses'), [
'route' => 'chill_person_household_addresses',
'routeParameters' => [
'household_id' => $household->getId()
]])
->setExtras(['order' => 30]);
}
}

View File

@@ -1,4 +1,3 @@
require('./sass/chillperson.scss');
require('./sass/person_with_period.scss');
require('./sass/household_banner.scss');
require('./sass/accompanying_period_work.scss');

View File

@@ -46,15 +46,6 @@
}
}
&.short {
.item {
padding-bottom: 0;
ul.record_actions {
margin-bottom: 0;
}
}
}
.updatedBy {
margin-top: 1rem;
text-align: right;
@@ -103,4 +94,3 @@ ul.timeline {
}
}
}

View File

@@ -1,6 +0,0 @@
.chill-entity__social-action {
.badge-primary {
background-color: var(--chill-green);
}
}

View File

@@ -18,6 +18,9 @@
<dl class="content-bloc" v-if="accompanyingCourse.requestor.type === 'person'">
<dt>{{ $t('requestor.birthdate') }}</dt>
<dd>{{ $d(accompanyingCourse.requestor.birthdate.datetime, 'short') }}</dd>
<dt>{{ $t('requestor.center') }}</dt>
<dd>{{ accompanyingCourse.requestor.center.name }}</dd>
@@ -115,12 +118,7 @@ export default {
get() {
return this.$store.state.accompanyingCourse.requestorAnonymous;
}
},
hasRequestorPersonBirthdate() {
console.log('hasRequestorBirthdate');
console.log(this.$store.state.accompanyingCourse.requestor);
return this.$store.state.accompanyingCourse.requestor.birthdate !== null;
},
}
},
methods: {
removeRequestor() {

View File

@@ -9,11 +9,11 @@
</span>
{{ resource.resource.text }}
</td>
<td v-if="resource.resource.type === 'person'">
&nbsp;
</td>
<td v-if="resource.resource.type === 'thirdparty'">
{{ $tc('person.born') }}{{ $d(resource.resource.birthdate.datetime, 'short') }}
</td>
<td v-else-if="resource.resource.type === 'thirdparty'">
{{ resource.resource.address.text }}<br>
{{ resource.resource.address.postcode.name }}
</td>

View File

@@ -118,12 +118,11 @@ export default {
modal.showModal = false;
},
addToHousehold() {
this.$store.dispatch('addDateToAddressAndAddressToHousehold', {
householdId: this.householdId,
addressId: this.$store.state.newAddress.address_id,
body: { validFrom: {datetime: `${this.validFrom}T00:00:00+0100`}},
backUrl: this.backUrl
})
this.$store.dispatch('addDateToAddressAndAddressToHousehold', {
householdId: this.householdId,
addressId: this.$store.state.newAddress.address_id,
body: { validFrom: {datetime: `${this.validFrom}T00:00:00+0100`}}
})
}
}
};

View File

@@ -4,7 +4,7 @@ const appMessages = {
fr: {
select_a_existing_address: 'Sélectionner une adresse existante',
create_a_new_address: 'Créer une nouvelle adresse',
add_an_address_to_household: 'Enregistrer',
add_an_address_to_household: 'Déménager le ménage',
validFrom: 'Date du déménagement',
move_date: 'Date du déménagement',
back_to_the_list: 'Retour à la liste',

View File

@@ -88,7 +88,6 @@ const store = createStore({
commit('addAddressToHousehold', household);
commit('setSuccess', true);
commit('setLoading', false);
window.location.assign(payload.backUrl);
resolve();
}))
.catch((error) => {

View File

@@ -122,7 +122,6 @@ export default {
return this.$store.state.allowHouseholdCreate;
},
allowHouseholdSearch() {
return false;
return this.$store.state.allowHouseholdSearch;
},
allowLeaveWithoutHousehold() {

View File

@@ -4,12 +4,8 @@
<span class="name">
{{ item.result.text }}
</span>
<span class="birthday" v-if="hasBirthdate">
<span class="birthday">
{{ $d(item.result.birthdate.datetime, 'short') }}
</span>
<span class="location" v-if="hasAddress">
{{ item.result.current_household_address.text }} -
{{ item.result.current_household_address.postcode.name }}
</span>
</div>
@@ -33,16 +29,8 @@ import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
export default {
name: 'SuggestionPerson',
components: {
OnTheFly,
OnTheFly
},
props: ['item'],
computed: {
hasBirthdate() {
return this.item.result.birthdate !== null;
},
hasAddress() {
return this.item.result.current_household_address !== null;
}
}
props: ['item']
}
</script>

View File

@@ -94,7 +94,7 @@
<li>
<i class="fa fa-li fa-map-marker"></i>
{%- if p.person.lastAddress is not empty -%}
{{ p.person.currentHouseholdAddress|chill_entity_render_box({'with_valid_from': false}) }}
{{ p.person.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }}
{%- else -%}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{%- endif -%}
@@ -113,7 +113,7 @@
) }}"
class="sc-button">
<i class="fa fa-home"></i>
n°&nbsp;{{ p.person.getCurrentHousehold.id }}
{{ 'household.Household file'|trans }}
</a>
</li>
{% endif %}
@@ -125,222 +125,189 @@
{% endfor %}
</div>
<h2>{{ 'Requestor'|trans }}</h2>
{% if accompanyingCourse.requestor == null %}
<p>{{ 'Any requestor to this accompanying course'|trans }}</p>
{% elseif accompanyingCourse.requestorPerson is not empty %}
{% set r = accompanyingCourse.requestorPerson %}
<div class="item-row">
<div class="item-col">
<h3>
{{ r.firstname ~ ' ' ~ r.lastname }}
<span class="badge badge-pill badge-secondary">{{ 'Usager' }}</span>
</h3>
<p>
{% set born = (r.gender == 'woman') ? 'née': 'né' %}
{% set gender = (r.gender == 'woman') ? 'fa-venus' :
(r.gender == 'man') ? 'fa-mars' : 'fa-neuter' %}
{% set genderTitle = (r.gender == 'woman') ? 'femme' :
(r.gender == 'homme') ? 'fa-mars' : 'neutre' %}
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle }}"></i>{{ born ~ ' le ' ~ r.birthdate|format_date('short') }}
</p>
</div>
<div class="item-col">
<ul class="list-content fa-ul">
<li>
{% if r.mobilenumber %}
<i class="fa fa-li fa-mobile"></i><a href="{{ 'tel:' ~ r.mobilenumber }}">{{ r.mobilenumber }}</a>
{% else %}
<i class="fa fa-li fa-phone"></i>
{% if r.phonenumber %}
<a href="{{ 'tel:' ~ r.phonenumber }}">{{ r.phonenumber }}</a>
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
{% endif %}
</li>
<li>
<i class="fa fa-li fa-map-marker"></i>
{%- if r.lastAddress is not empty -%}
{{ r.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }}
{%- else -%}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{%- endif -%}
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_view', { person_id: r.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
</ul>
</div>
</div>
{% elseif accompanyingCourse.requestorThirdParty is not empty %}
{% set r = accompanyingCourse.requestorThirdParty %}
<div class="item-row">
<div class="item-col">
<h3>
{{ r.name }}
<span class="badge badge-pill badge-secondary">{{ 'Tiers' }}</span>
</h3>
</div>
<div class="item-col">
<ul class="list-content fa-ul">
<li><i class="fa fa-li fa-envelope-o"></i>
<a href="{{ 'mailto:' ~ r.email }}">
{{ r.email|chill_print_or_message("thirdparty.No_email") }}
</a>
</li>
<li><i class="fa fa-li fa-phone"></i>
{% if r.telephone %}
<a href="{{ 'tel:' ~ r.telephone }}">{{ r.telephone }}</a>
{% else %}
<span class="chill-no-data-statement">{{ 'thirdparty.No_phonenumber'|trans }}</span>
{% endif %}
</li>
<li><i class="fa fa-li fa-map-marker"></i>
{%- if r.address is not empty -%}
{{ r.getAddress|chill_entity_render_box({'with_valid_from': false}) }}
{%- else -%}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{%- endif -%}
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('chill_3party_3party_show', { thirdparty_id: r.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
</ul>
</div>
</div>
{% endif %}
<h2>{{ 'Resources'|trans }}</h2>
<div class="flex-bloc">
{% for r in accompanyingCourse.resources %}
<div class="item-bloc">
{% if r.person %}
{% if accompanyingCourse.resources|length == 0 %}
<p class="chill-no-data-statement">{{ 'Any resource for this accompanying course'|trans }}</p>
{% else %}
<div class="flex-bloc">
{% for r in accompanyingCourse.resources %}
<div class="item-bloc">
{% if r.person %}
<div class="item-row">
<div class="item-col">
<h3>
{{ r.person.firstname ~ ' ' ~ r.person.lastname }}
<span class="badge badge-pill badge-secondary">{{ 'Usager' }}</span>
</h3>
<p>
{% set born = (r.person.gender == 'woman') ? 'née': 'né' %}
{% set gender = (r.person.gender == 'woman') ? 'fa-venus' :
(r.person.gender == 'man') ? 'fa-mars' : 'fa-neuter' %}
{% set genderTitle = (r.person.gender == 'woman') ? 'femme' :
(r.person.gender == 'homme') ? 'fa-mars' : 'neutre' %}
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle }}"></i>{{ born ~ ' le ' ~ r.person.birthdate|format_date('short') }}
</p>
</div>
<div class="item-col">
<ul class="list-content fa-ul">
<li>
{% if r.person.mobilenumber %}
<i class="fa fa-li fa-mobile"></i><a href="{{ 'tel:' ~ r.person.mobilenumber }}">{{ r.person.mobilenumber }}</a>
{% else %}
<i class="fa fa-li fa-phone"></i>
{% if r.person.phonenumber %}
<a href="{{ 'tel:' ~ r.person.phonenumber }}">{{ r.person.phonenumber }}</a>
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
{% endif %}
</li>
<li>
<i class="fa fa-li fa-map-marker"></i>
{%- if r.person.lastAddress is not empty -%}
{{ r.person.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }}
{%- else -%}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{%- endif -%}
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_view', { person_id: r.person.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
</ul>
</div>
</div>
<div class="item-row">
<div class="item-col">
<h3>
{{ r.person.firstname ~ ' ' ~ r.person.lastname }}
<span class="badge badge-pill badge-secondary">{{ 'Usager' }}</span>
</h3>
<p>
{% set born = (r.person.gender == 'woman') ? 'née': 'né' %}
{% set gender = (r.person.gender == 'woman') ? 'fa-venus' :
(r.person.gender == 'man') ? 'fa-mars' : 'fa-neuter' %}
{% set genderTitle = (r.person.gender == 'woman') ? 'femme' :
(r.person.gender == 'homme') ? 'fa-mars' : 'neutre' %}
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle }}"></i>{{ born ~ ' le ' ~ r.person.birthdate|format_date('short') }}
</p>
</div>
<div class="item-col">
<ul class="list-content fa-ul">
<li>
{% if r.person.mobilenumber %}
<i class="fa fa-li fa-mobile"></i><a href="{{ 'tel:' ~ r.person.mobilenumber }}">{{ r.person.mobilenumber }}</a>
{% else %}
<i class="fa fa-li fa-phone"></i>
{% if r.person.phonenumber %}
<a href="{{ 'tel:' ~ r.person.phonenumber }}">{{ r.person.phonenumber }}</a>
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
{% endif %}
</li>
<li>
<i class="fa fa-li fa-map-marker"></i>
{%- if r.person.lastAddress is not empty -%}
{{ r.person.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }}
{%- else -%}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{%- endif -%}
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_view', { person_id: r.person.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
</ul>
</div>
</div>
{% endif %}
{% if r.thirdParty %}
<<<<<<< HEAD
{% endif %}
{% if r.thirdParty %}
<div class="item-row">
<div class="item-col">
<h3>
{{ r.thirdParty.name }}
<span class="badge badge-pill badge-secondary">{{ 'Tiers' }}</span>
</h3>
</div>
<div class="item-col">
<ul class="list-content fa-ul">
<li><i class="fa fa-li fa-envelope-o"></i>
<a href="{{ 'mailto:' ~ r.thirdParty.email }}">
{{ r.thirdParty.email|chill_print_or_message("thirdparty.No_email") }}
</a>
</li>
<li><i class="fa fa-li fa-phone"></i>
{% if r.thirdParty.telephone %}
<a href="{{ 'tel:' ~ r.thirdParty.telephone }}">{{ r.thirdParty.telephone }}</a>
{% else %}
<span class="chill-no-data-statement">{{ 'thirdparty.No_phonenumber'|trans }}</span>
{% endif %}
</li>
<li><i class="fa fa-li fa-map-marker"></i>
{%- if r.thirdParty.address is not empty -%}
{{ r.thirdParty.getAddress|chill_entity_render_box({'with_valid_from': false}) }}
{%- else -%}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{%- endif -%}
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('chill_3party_3party_show', { thirdparty_id: r.thirdParty.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
</ul>
</div>
</div>
<div class="item-row">
<div class="item-col">
<h3>
{{ r.thirdParty.name }}
<span class="badge badge-pill badge-secondary">{{ 'Tiers' }}</span>
</h3>
</div>
<div class="item-col">
<ul class="list-content fa-ul">
<li><i class="fa fa-li fa-envelope-o"></i>
<a href="{{ 'mailto:' ~ r.thirdParty.email }}">
{{ r.thirdParty.email|chill_print_or_message("thirdparty.No_email") }}
</a>
</li>
<li><i class="fa fa-li fa-phone"></i>
{% if r.thirdParty.telephone %}
<a href="{{ 'tel:' ~ r.thirdParty.telephone }}">{{ r.thirdParty.telephone }}</a>
{% else %}
<span class="chill-no-data-statement">{{ 'thirdparty.No_phonenumber'|trans }}</span>
{% endif %}
</li>
<li><i class="fa fa-li fa-map-marker"></i>
{%- if r.thirdParty.address is not empty -%}
{{ r.thirdParty.getAddress|chill_entity_render_box({'with_valid_from': false}) }}
{%- else -%}
<span class="chill-no-data-statement">{{ 'No address given'|trans }}</span>
{%- endif -%}
</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('chill_3party_3party_show', { thirdparty_id: r.thirdParty.id }) }}" class="sc-button bt-show" target="_blank" title="Voir"></a>
</li>
</ul>
</div>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
{% endif %}
</div>
{% endfor %}
</div>
<h2>{{ 'Social actions'|trans }}</h2>
<div id="accompanying_course_work_list" class="short">
<div id="accompanying_course_work_list">
{% for w in works %}
<div class="item">
<div class="title">
<p class="title_label">{{ 'accompanying_course_work.action'|trans }}</p >
<h2 class="action_title">
{{ w.socialAction|chill_entity_render_box({ 'no-badge': false }) }}
</h2>
</div>
<div class="actions">
<ul class="record_actions">
<li>
<a
class="sc-button bt-edit"
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}">{{ 'Edit'|trans }}</a>
</li>
</ul>
</div>
<div class="timeline">
<ul class="timeline">
<li class="completed">
<div class="date">
<span>{{ w.createdAt|format_date('long') }}</span>
</div>
<div class="label">
<span>{{ 'accompanying_course_work.create_date'|trans }}</span>
</div>
</li>
<li class="completed">
<div class="date">
<span>{{ w.startDate|format_date('long') }}</span>
</div>
<div class="label">
<span>{{ 'accompanying_course_work.start_date'|trans }}</span>
</div>
</li>
<li class="{%if date(w.endDate) < date('now') %}completed{% endif %}">
<div class="date">
<span>{{ w.endDate|format_date('long') }}</span>
</div>
<div class="label">
<span>{{ 'accompanying_course_work.end_date'|trans }}</span>
</div>
</li>
</ul>
</div>
{% if w.results|length > 0 %}
<div class="objective_results objective_results__without-objectives">
<div class="obj without_objective">
<p class="title_label">{{ 'accompanying_course_work.goal'|trans }}</p>
<p class="chill-no-data-statement">{{ 'accompanying_course_work.results without objective'|trans }}</p>
</div>
<div class="res results">
<p class="title_label">{{ 'accompanying_course_work.results'|trans }}</p>
<ul class="result_list">
{% for r in w.results %}
<li class="badge badge-primary">{{ r.title|localize_translatable_string }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if w.goals|length > 0 %}
{% for g in w.goals %}
<div class="objective_results objective_results--with-objectives">
<div class="objective obj">
<p class="title_label">{{ 'accompanying_course_work.goal'|trans }}</p>
<h3 class="goal_title">{{ g.goal.title|localize_translatable_string }}</h3>
</div>
<div class="results res">
{% if g.results|length == 0 %}
<p class="title_label">{{ 'accompanying_course_work.results'|trans }}</p>
<p class="chill-no-data-statement">{{ 'accompanying_course_work.no_results'|trans }}</p>
{% else %}
<p class="title_label">{{ 'accompanying_course_work.results'|trans }}</p>
<ul class="result_list">
{% for r in g.results %}
<li class="badge badge-primary">{{ r.title|localize_translatable_string }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endfor %}
{% endif %}
<div class="updatedBy">
{{ 'Last updated by'|trans}}: {{ w.updatedBy|chill_entity_render_box }}, {{ w.updatedAt|format_datetime('long', 'short') }}
</div>
</div>
{% else %}
<p class="chill-no-data-statement">{{ 'accompanying_course_work.Any work'|trans }}</p>
@@ -350,7 +317,7 @@
{% block contentActivity %}
{% set person = null %}
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse', 'context': 'accompanyingCourse'} %}
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse', 'context': 'person'} %}
{% endblock %}
{# ==> insert accompanyingCourse vue component #}

View File

@@ -12,7 +12,7 @@
<div class="title">
<p class="title_label">{{ 'accompanying_course_work.action'|trans }}</p >
<h2 class="action_title">
{{ w.socialAction|chill_entity_render_box }}
{{ w.socialAction|chill_entity_render_box({ 'no-badge': true }) }}
</h2>
</div>
@@ -67,7 +67,7 @@
<div class="objective_results objective_results--with-objectives">
<div class="objective obj">
<p class="title_label">{{ 'accompanying_course_work.goal'|trans }}</p>
<h4 class="goal_title">{{ g.goal.title|localize_translatable_string }}</h4>
<h3 class="goal_title">{{ g.goal.title|localize_translatable_string }}</h3>
</div>
<div class="results res">
{% if g.results|length == 0 %}
@@ -96,7 +96,7 @@
<li>
<a
class="sc-button bt-edit"
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}">{{ 'Edit'|trans }}</a>
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}">{{ 'Update'|trans }}</a>
</li>
</ul>
</div>

View File

@@ -1,136 +0,0 @@
{% block content %}
{% for accompanying_period in accompanying_periods %}
<div class="flex-table">
<div class="item-bloc">
<div class="item-row">
<div class="item-col">
{{'period'|trans}} <b>#{{ accompanying_period.id }}</b>
{% if accompanying_period.emergency %}
&nbsp;
<span class="badge badge-primary">
{{- 'Emergency'|trans|upper -}}
</span>
{% endif %}
{% if accompanying_period.confidential %}
&nbsp;
<span class="badge badge-primary">
{{- 'Confidential'|trans|upper -}}
</span>
{% endif %}
{% if accompanying_period.step == 'DRAFT' %}
&nbsp;
<span class="badge badge-primary">
{{- 'Draft'|trans|upper -}}
</span>
{% else %}
<span class="badge badge-primary">
{{- 'Confirmed'|trans|upper -}}
</span>
{% endif %}
</div>
<div class="item-col">
{% if chill_accompanying_periods.fields.user == 'visible' %}
{% if accompanying_period.user %}
{{ accompanying_period.user.username }}
{% else %}
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
{% endif %}
{% endif %}
</div>
</div>
<div class="item-row">
{% if accompanying_period.closingDate == null %}
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }}
{% else %}
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
'%opening_date%': accompanying_period.openingDate|format_date('long'),
'%closing_date%': accompanying_period.closingDate|format_date('long')}
) }}
{% if accompanying_period.isOpen == false %}
<dl class="chill_view_data">
<dt>{{ 'Closing motive'|trans }}&nbsp;:</dt>
<dd>{{ accompanying_period.closingMotive|chill_entity_render_box }}</dd>
</dl>
{% endif %}
{% endif %}
</div>
<div class="item-col">
<h3>{{ 'Participants'|trans }}</h3>
{% if accompanying_period.participations.count > 0 %}
{% for p in accompanying_period.participations %}
<p>
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
{{ p.person.firstname ~ ' ' ~ p.person.lastname }}
</a>
</p>
{% endfor %}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
</div>
<div class="item-col">
<h3>{{ 'Requestor'|trans }}</h3>
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %}
{% if accompanying_period.requestorPerson is not null %}
<p>{{ accompanying_period.requestorPerson.firstname ~ ' ' ~ accompanying_period.requestorPerson.lastname }}</p>
{% endif %}
{% if accompanying_period.requestorThirdParty is not null %}
<p>{{ accompanying_period.requestorThirdParty.name }}</p>
{% endif %}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
</div>
<div class="item-col">
<h3>{{ 'Social issues'|trans }}</h3>
{% if accompanying_period.socialIssues.count > 0 %}
{% for si in accompanying_period.socialIssues %}
<p>{{ si.title|localize_translatable_string }}</p>
{% endfor %}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
</div>
<div class="item-row">
<ul class="record_actions">
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
<li>
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': accompanying_period.id }) }}" class="sc-button bt-show"></a>
</li>
{#
<li>
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-update no-content"></a>
</li>
{% if accompanying_period.isOpen == true %}
<li>
<a href="{{ path('chill_person_accompanying_period_close', {'person_id' : person.id}) }}" class="sc-button bt-update has-hidden change-icon">
<i class="fa fa-lock" aria-hidden="true"></i><span class="show-on-hover">{{'Close accompanying period'|trans }}</span>
</a>
</li>
{% endif %}
{% if accompanying_period.canBeReOpened(person) == true %}
<li>
<a href="{{ path('chill_person_accompanying_period_re_open', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-create change-icon has-hidden">
<i class="fa fa-unlock" aria-hidden="true"></i><span class="show-on-hover">{{'Re-open accompanying period'|trans }}</span>
</a>
</li>
{% endif %}
#}
</ul>
</div>
</div>
</div>
<p></p>
{% endfor %}
{% endblock content %}

View File

@@ -5,36 +5,139 @@
{% block title %}{{ 'Person accompanying period - %name%'|trans({ '%name%' : person.__toString}) }}{% endblock title %}
{% block personcontent %}
<h1>{{ 'Accompanying period list'|trans }}</h1>
{% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path ('chill_person_view', {'person_id' : person.id } ) }}" class="sc-button bt-cancel">
{{ 'Person details'|trans }}
</a>
</li>
<li>
<a href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}" class="sc-button bt-create">
{{ 'Create an accompanying period'|trans }}
</a>
</li>
{#
<li>
<a href="{{ path ('chill_person_accompanying_period_create', {'person_id' : person.id } ) }}" class="sc-button bt-create has-hidden">
<span class="show-on-hover">{{ 'Add an accompanying period in the past'|trans }}</span>
</a>
</li>
{% if person.isOpen == false %}
<li>
<a href="{{ path('chill_person_accompanying_period_open', {'person_id' : person.id} ) }}" class="sc-button bt-create change-icon has-hidden">
<i class="fa fa-unlock" aria-hidden="true"></i>
<span class="show-on-hover">{{'Begin a new accompanying period'|trans }}</span>
</a>
</li>
{% endif %}
#}
</ul>
{% for accompanying_period in accompanying_periods %}
{% endblock %}
<div class="flex-table">
<div class="item-bloc">
<div class="item-row">
<div class="item-col">
{{'Accompanying period'|trans}} #{{ accompanying_period.id }}
</div>
<div class="item-col">
{% if chill_accompanying_periods.fields.user == 'visible' %}
{% if accompanying_period.user %}
{{ accompanying_period.user.username }}
{% else %}
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
{% endif %}
{% endif %}
</div>
</div>
<div class="item-row">
{% if accompanying_period.closingDate == null %}
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }}
{% else %}
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
'%opening_date%': accompanying_period.openingDate|format_date('long'),
'%closing_date%': accompanying_period.closingDate|format_date('long')}
) }}
{% if accompanying_period.isOpen == false %}
<dl class="chill_view_data">
<dt>{{ 'Closing motive'|trans }}&nbsp;:</dt>
<dd>{{ accompanying_period.closingMotive|chill_entity_render_box }}</dd>
</dl>
{% endif %}
{% endif %}
</div>
<div class="item-row">
<h3>{{ 'Participants'|trans }}</h3>
{% if accompanying_period.participations.count > 0 %}
{% for p in accompanying_period.participations %}
<p>
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
{{ p.person.firstname ~ ' ' ~ p.person.lastname }}
</a>
</p>
{% endfor %}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
</div>
<div class="item-col">
<h3>{{ 'Requestors'|trans }}</h3>
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %}
{% if accompanying_period.requestorPerson is not null %}
<p>{{ accompanying_period.requestorPerson.firstname ~ ' ' ~ accompanying_period.requestorPerson.lastname }}</p>
{% endif %}
{% if accompanying_period.requestorThirdParty is not null %}
<p>{{ accompanying_period.requestorThirdParty.name }}</p>
{% endif %}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
{% endif %}
</div>
<div class="item-row">
<ul class="record_actions">
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
<li>
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': accompanying_period.id }) }}" class="sc-button bt-show"></a>
</li>
{#
<li>
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-update no-content"></a>
</li>
{% if accompanying_period.isOpen == true %}
<li>
<a href="{{ path('chill_person_accompanying_period_close', {'person_id' : person.id}) }}" class="sc-button bt-update has-hidden change-icon">
<i class="fa fa-lock" aria-hidden="true"></i><span class="show-on-hover">{{'Close accompanying period'|trans }}</span>
</a>
</li>
{% endif %}
{% if accompanying_period.canBeReOpened(person) == true %}
<li>
<a href="{{ path('chill_person_accompanying_period_re_open', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-create change-icon has-hidden">
<i class="fa fa-unlock" aria-hidden="true"></i><span class="show-on-hover">{{'Re-open accompanying period'|trans }}</span>
</a>
</li>
{% endif %}
#}
</ul>
</div>
</div>
</div>
<p></p>
{% endfor %}
<div class="form_control">
<ul class="record_actions">
<li class="cancel">
<a href="{{ path ('chill_person_view', {'person_id' : person.id } ) }}" class="sc-button bt-cancel">
{{ 'Person details'|trans }}
</a>
</li>
<li>
<a href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}" class="sc-button bt-create">
{{ 'Create an accompanying period'|trans }}
</a>
</li>
{#
<li>
<a href="{{ path ('chill_person_accompanying_period_create', {'person_id' : person.id } ) }}" class="sc-button bt-create has-hidden">
<span class="show-on-hover">{{ 'Add an accompanying period in the past'|trans }}</span>
</a>
</li>
{% if person.isOpen == false %}
<li>
<a href="{{ path('chill_person_accompanying_period_open', {'person_id' : person.id} ) }}" class="sc-button bt-create change-icon has-hidden">
<i class="fa fa-unlock" aria-hidden="true"></i>
<span class="show-on-hover">{{'Begin a new accompanying period'|trans }}</span>
</a>
</li>
{% endif %}
#}
</ul>
</div>
{% endblock personcontent %}

View File

@@ -1,25 +0,0 @@
{% extends '@ChillPerson/Household/layout.html.twig' %}
{% block title 'Household accompanying period'|trans %}
{% block content %}
<h1>{{ block('title') }}</h1>
{% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %}
<div class="form_control">
<ul class="record_actions">
<li class="cancel">
<a href="{{ path ('chill_person_household_summary', {'household_id' : household.id } ) }}" class="sc-button bt-cancel">
{{ 'Household summary'|trans }}
</a>
</li>
{#<li>
<a href="{{ path ('chill_person_household_accompanying_course_new', {'household_id' : [ household.id ] } ) }}" class="sc-button bt-create">
{{ 'Create an accompanying period'|trans }}
</a>
</li>#}
</ul>
</div>
{% endblock %}

View File

@@ -12,11 +12,11 @@
{% else %}
<div class="top"><i class="fa fa-caret-up fa-3x"></i></div>
{% endif %}
{% for address in household.addresses %}
<div class="col-b"></div>
<div class="col-c content{{ ' row' ~ loop.index }}">
<div class="address">
{% if address.isNoAddress == true %}
@@ -39,22 +39,22 @@
{% endif %}
</div>
{#<ul class="record_actions">
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_household_address_edit', { 'household_id': household.id, 'address_id' : address.id } ) }}" class="sc-button bt-edit"></a>
</li>
</ul> #}
</ul>
</div>
<div class="date">
{% if address.validFrom is not empty %}
{{ address.validFrom|format_date('long') }}
{% endif %}
</div>
{% endfor %}
</div>
<ul class="record_actions">

View File

@@ -30,19 +30,19 @@
<div id="banner-misc">
{%- set members = household.getCurrentMembersOrdered() -%}
{%- if members|length > 0 -%}
<span class="current-members-explain">
{{- 'household.Current household members'|trans }}:
</span>
{%- for m in members|slice(0, 5) -%}
{{- m.person|chill_entity_render_box({'addLink': false}) -}}
{%- if m.holder %} <span class="badge badge-primary">{{ 'household.holder'|trans }}</span>{% endif -%}
{%- if false == loop.last -%}, {% endif -%}
{%- endfor -%}
{% if members|length > 5 %}
<span class="current-members-more">
{{ 'household.and x other persons'|trans({'x': members|length-5}) }}
</span>
{% endif %}
<span class="current-members-explain">
{{- 'household.Current household members'|trans }}:
</span>
{%- for m in members|slice(0, 5) -%}
{{- m.person|chill_entity_render_box({'addLink': false}) -}}
{%- if m.holder %} <span class="badge badge-primary">{{ 'household.holder'|trans }}</span>{% endif -%}
{%- if false == loop.last -%}, {% endif -%}
{%- endfor -%}
{% if members|length > 5 %}
<span class="current-members-more">
{{ 'household.and x other persons'|trans({'x': members|length-5}) }}
</span>
{% endif %}
{%- endif -%}
</div>
</div>

View File

@@ -16,8 +16,8 @@
#}
<ul class="tab-nav">
{% for menu in menus %}
<li class="{{ menu.extra('class') }}">
<li class="">
<a href="{{ menu.uri }}" >{{ menu.label|upper }}</a>
</li>
{% endfor %}
</ul>
</ul>

View File

@@ -14,6 +14,6 @@ module.exports = function(encore, entries)
encore.addEntry('household_edit_metadata', __dirname + '/Resources/public/modules/household_edit_metadata/index.js');
encore.addEntry('accompanying_course_work_create', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkCreate/index.js');
encore.addEntry('accompanying_course_work_edit', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js');
encore.addEntry('accompanying_course_work_list', __dirname + '/Resources/public/modules/accompanying_course_work_list/index.js');
encore.addEntry('person', __dirname + '/Resources/public/js/person.js');
encore.addEntry('accompanying_course_work_list', __dirname + '/Resources/public/modules/accompanying_course_work_list/index.js');
};

View File

@@ -38,13 +38,12 @@ household:
Edit member household: Modifier l'appartenance au ménage
Current household members: Membres actuels
Household summary: Résumé
Accompanying period: Parcours d'accompagnement
Addresses: Adresses
Current address: Adresse actuelle
Household does not have any address currently: Le ménage n'a pas d'adresse renseignée actuellement
Edit household members: Modifier l'appartenance au ménage
and x other persons: >-
{x, plural,
{x, plural,
one {et une autre personne}
many {et # autres personnes}
other {et # autres personnes}
@@ -60,7 +59,7 @@ household:
data_saved: Données enregistrées
Household history for %name%: Historique des ménages pour {name}
Household shared: Ménages domiciliés
Household not shared: Ménage non domiciliés
Household not shared: Ménage non domiciliés
Never in any household: Membre d'aucun ménage
Membership currently running: En cours
from: Depuis

View File

@@ -165,8 +165,7 @@ An accompanying period starts: Une période d'accompagnement est ouverte
Any accompanying periods are open: Aucune période d'accompagnement ouverte
An accompanying period is open: Une période d'accompagnement est ouverte
Accompanying period list: Périodes d'accompagnement
Accompanying period: Parcours d'accompagnement
period: Parcours
Accompanying period: Période d'accompagnement
New accompanying course: Nouveau parcours d'accompagnement
Choose a motive: Motif de fermeture
Re-open accompanying period: Ré-ouvrir
@@ -182,8 +181,6 @@ Create an accompanying course: Créer un parcours
This accompanying course is still a draft: Ce parcours est à l'état brouillon
Associated peoples: Usagers concernés
Resources: Interlocuteurs privilégiés
Requestor: Demandeur
Any requestor to this accompanying course: Aucun demandeur pour ce parcours
Social actions: Actions d'accompagnement
Social issues: Problématiques sociales
Last events on accompanying course: Dernières actions de suivi
@@ -193,7 +190,6 @@ See accompanying period: Voir cette période d'accompagnement
Referrer: Référent
Some peoples does not belong to any household currently. Add them to an household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur appartenance à un ménage dès que possible.
Add to household now: Ajouter à un ménage
Any resource for this accompanying course: Aucun interlocuteur privilégié pour ce parcours
# pickAPersonType
Pick a person: Choisir une personne
@@ -325,9 +321,6 @@ accompanying_period:
dates_from_%opening_date%_to_%closing_date%: Ouvert du %opening_date% au %closing_date%
occasional: ponctuel
regular: régulier
Confidential: confidentiel
Draft: brouillon
Confirmed: en file active
# Accompanying Course
Accompanying Course: Parcours d'accompagnement
@@ -345,8 +338,6 @@ Members: Membres
Addresses: Adresses
Move household: Nouveau déménagement
Addresses history for household: Historique des adresses
Household accompanying period: Parcours d'accompagnement du ménage
Household summary: Résumé du ménage
# accompanying course work
Accompanying Course Actions: Actions d'accompagnements