mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 06:14:23 +00:00
Merge branch 'master' of git://github.com/Chill-project/Activity
This commit is contained in:
commit
7e688d8573
@ -81,11 +81,24 @@ class ActivityController extends Controller
|
|||||||
$em->persist($entity);
|
$em->persist($entity);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
|
$this->get('session')
|
||||||
|
->getFlashBag()
|
||||||
|
->add('success',
|
||||||
|
$this->get('translator')
|
||||||
|
->trans('Success : activity created!')
|
||||||
|
);
|
||||||
|
|
||||||
return $this->redirect(
|
return $this->redirect(
|
||||||
$this->generateUrl('chill_activity_activity_show',
|
$this->generateUrl('chill_activity_activity_show',
|
||||||
array('id' => $entity->getId(), 'person_id' => $person_id)));
|
array('id' => $entity->getId(), 'person_id' => $person_id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->get('session')
|
||||||
|
->getFlashBag()->add('danger',
|
||||||
|
$this->get('translator')
|
||||||
|
->trans('The form is not valid. The activity has not been created !')
|
||||||
|
);
|
||||||
|
|
||||||
return $this->render('ChillActivityBundle:Activity:new.html.twig', array(
|
return $this->render('ChillActivityBundle:Activity:new.html.twig', array(
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
@ -113,8 +126,6 @@ class ActivityController extends Controller
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$form->add('submit', 'submit', array('label' => 'Create'));
|
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,8 +244,6 @@ class ActivityController extends Controller
|
|||||||
'role' => new Role('CHILL_ACTIVITY_UPDATE')
|
'role' => new Role('CHILL_ACTIVITY_UPDATE')
|
||||||
));
|
));
|
||||||
|
|
||||||
$form->add('submit', 'submit', array('label' => 'Update'));
|
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -261,9 +270,23 @@ class ActivityController extends Controller
|
|||||||
if ($editForm->isValid()) {
|
if ($editForm->isValid()) {
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('chill_activity_activity_edit', array('id' => $id, 'person_id' => $person_id)));
|
$this->get('session')
|
||||||
|
->getFlashBag()
|
||||||
|
->add('success',
|
||||||
|
$this->get('translator')
|
||||||
|
->trans('Success : activity updated!')
|
||||||
|
);
|
||||||
|
|
||||||
|
return $this->redirect($this->generateUrl('chill_activity_activity_show', array('id' => $id, 'person_id' => $person_id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->get('session')
|
||||||
|
->getFlashBag()
|
||||||
|
->add('danger',
|
||||||
|
$this->get('translator')
|
||||||
|
->trans('The form is not valid. The activity has not been updated !')
|
||||||
|
);
|
||||||
|
|
||||||
return $this->render('ChillActivityBundle:Activity:edit.html.twig', array(
|
return $this->render('ChillActivityBundle:Activity:edit.html.twig', array(
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
'edit_form' => $editForm->createView(),
|
'edit_form' => $editForm->createView(),
|
||||||
|
@ -67,7 +67,10 @@ class ActivityType extends AbstractType
|
|||||||
'widget' => 'single_text',
|
'widget' => 'single_text',
|
||||||
'format' => 'dd-MM-yyyy')
|
'format' => 'dd-MM-yyyy')
|
||||||
)
|
)
|
||||||
->add('durationTime', 'time')
|
->add('durationTime', 'time', array(
|
||||||
|
'widget' => 'text',
|
||||||
|
'hours' => array(0, 1, 2, 3, 4, 5, 6, 7, 8)
|
||||||
|
))
|
||||||
->add('remark', 'textarea', array(
|
->add('remark', 'textarea', array(
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'empty_data' => ''
|
'empty_data' => ''
|
||||||
|
@ -14,13 +14,21 @@ not present: absent
|
|||||||
Delete: Supprimer
|
Delete: Supprimer
|
||||||
Update: Mettre à jour
|
Update: Mettre à jour
|
||||||
Update activity: Édition de l'activité
|
Update activity: Édition de l'activité
|
||||||
|
Scope: Cercle
|
||||||
|
|
||||||
#forms
|
#forms
|
||||||
Activity creation: Nouvelle activité
|
Activity creation: Nouvelle activité
|
||||||
Create: Créer
|
Create: Créer
|
||||||
Back to the list: Retour à la liste
|
Back to the list: Retour à la liste
|
||||||
|
Save activity: Sauver l'activité
|
||||||
|
Reset form: Remise à zéro du formulaire
|
||||||
|
|
||||||
#timeline
|
#timeline
|
||||||
'%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date%
|
'%user% has done an %activity_type% on %date%': %user% a effectué une activité de type "%activity_type%" le %date%
|
||||||
|
|
||||||
|
#controller
|
||||||
|
'Success : activity created!': Bravo ! L'activité a été créée.
|
||||||
|
'The form is not valid. The activity has not been created !': Le formulaire est invalide. L'activité n'a pas été créée.
|
||||||
|
'Success : activity updated!': Bravo ! L'activité a été mise à jour.
|
||||||
|
'The form is not valid. The activity has not been updated !': Le formulaire est invalide. L'activité n'a pas été mise à jour.
|
||||||
|
|
||||||
|
@ -23,7 +23,20 @@
|
|||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
<h1>{{ "Update activity"|trans }}</h1>
|
<h1>{{ "Update activity"|trans }}</h1>
|
||||||
|
|
||||||
{{ form(edit_form) }}
|
{{ form_start(edit_form) }}
|
||||||
|
|
||||||
|
{{ form_widget(edit_form) }}
|
||||||
|
<div class="grid-12 centered sticky-form-buttons">
|
||||||
|
<button class="sc-button green margin-10" type="submit"><i class="fa fa-save"></i> {{ 'Save activity'|trans }}</button>
|
||||||
|
<button class="sc-button red margin-10" type="reset"><i class="fa fa-eraser"></i> {{ 'Reset form'|trans }}</button>
|
||||||
|
</div>
|
||||||
|
{{ form_end(edit_form) }}
|
||||||
|
|
||||||
{# {{ form(delete_form) }} #}
|
{# {{ form(delete_form) }} #}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block js %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
chill.displayAlertWhenLeavingModifiedForm('form[name="{{ edit_form.vars.form.vars.name }}"]', '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
<th>{{'Duration Time' | trans }}</th>
|
<th>{{'Duration Time' | trans }}</th>
|
||||||
<th>{{'Reason' | trans}}</th>
|
<th>{{'Reason' | trans}}</th>
|
||||||
<th>{{'Type' | trans}}</th>
|
<th>{{'Type' | trans}}</th>
|
||||||
<th>{{'Attendee' | trans }}</th>
|
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -40,7 +39,6 @@
|
|||||||
<td>{{ activity.durationTime|date('H:i') }}</td>
|
<td>{{ activity.durationTime|date('H:i') }}</td>
|
||||||
<td>{{ activity.reason.name | localize_translatable_string }}</td>
|
<td>{{ activity.reason.name | localize_translatable_string }}</td>
|
||||||
<td>{{ activity.type.name | localize_translatable_string }}</td>
|
<td>{{ activity.type.name | localize_translatable_string }}</td>
|
||||||
<td>{{ activity.attendee }}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person.id }) }}">{{ 'Show the activity' | trans }}</a>
|
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person.id }) }}">{{ 'Show the activity' | trans }}</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -23,13 +23,17 @@
|
|||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
<h1>{{ "Activity creation"|trans }}</h1>
|
<h1>{{ "Activity creation"|trans }}</h1>
|
||||||
|
|
||||||
{{ form(form) }}
|
{{ form_start(form) }}
|
||||||
|
|
||||||
<ul class="record_actions">
|
{{ form_widget(form) }}
|
||||||
<li>
|
<div class="grid-12 centered sticky-form-buttons">
|
||||||
<a href="{{ path('chill_activity_activity_list', {'person_id': person.id}) }}">
|
<button class="sc-button green margin-10" type="submit"><i class="fa fa-save"></i> {{ 'Add a new activity'|trans }}</button>
|
||||||
{{ "Back to the list" | trans }}
|
</div>
|
||||||
</a>
|
{{ form_end(form) }}
|
||||||
</li>
|
{% endblock %}
|
||||||
</ul>
|
|
||||||
|
{% block js %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
chill.displayAlertWhenLeavingUnsubmittedForm('form[name="{{ form.vars.form.vars.name }}"]', '{{ "You are going to leave a page with unsubmitted data. Are you sure you want to leave ?"|trans }}');
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -3,6 +3,8 @@
|
|||||||
{% set activeRouteKey = 'chill_activity_activity_list' %}
|
{% set activeRouteKey = 'chill_activity_activity_list' %}
|
||||||
|
|
||||||
{% block personcontent -%}
|
{% block personcontent -%}
|
||||||
|
<h1>{{ "Activity"|trans }}</h1>
|
||||||
|
|
||||||
<a href="{{ path('chill_activity_activity_edit', { 'id': entity.id, 'person_id': person.id }) }}">
|
<a href="{{ path('chill_activity_activity_edit', { 'id': entity.id, 'person_id': person.id }) }}">
|
||||||
<i class="fa fa-pencil"></i> {{ 'Edit the activity'|trans }}
|
<i class="fa fa-pencil"></i> {{ 'Edit the activity'|trans }}
|
||||||
</a>
|
</a>
|
||||||
@ -23,9 +25,9 @@
|
|||||||
<dt class="inline">{{ 'Type'|trans }}</dt>
|
<dt class="inline">{{ 'Type'|trans }}</dt>
|
||||||
<dd>{{ entity.type.name | localize_translatable_string }}</dd>
|
<dd>{{ entity.type.name | localize_translatable_string }}</dd>
|
||||||
<dt class="inline">{{ 'Attendee'|trans }}</dt>
|
<dt class="inline">{{ 'Attendee'|trans }}</dt>
|
||||||
<dd>{{ entity.attendee }}</dd>
|
<dd>{% if entity.attendee is not null %}{% if entity.attendee %}{{ 'present'|trans|capitalize }} {% else %} {{ 'not present'|trans|capitalize }}{% endif %}{% else %}{{ 'None'|trans|capitalize }}{% endif %}</dd>
|
||||||
<dt class="inline">{{ 'Remark'|trans }}</dt>
|
<dt class="inline">{{ 'Remark'|trans }}</dt>
|
||||||
<dd>{{ entity.remark }}</dd>
|
<dd>{% if entity.remark is empty %}{{ 'No remarks'|trans }}{% else %}<pre>{{ entity.remark }}</pre>{% endif %}</dd>
|
||||||
<dt class="inline">{{ ''|trans }}</dt>
|
<dt class="inline">{{ ''|trans }}</dt>
|
||||||
<dd></dd>
|
<dd></dd>
|
||||||
<dt class="inline">{{ ''|trans }}</dt>
|
<dt class="inline">{{ ''|trans }}</dt>
|
||||||
@ -36,5 +38,5 @@
|
|||||||
<i class="fa fa-pencil"></i> {{ 'Edit the activity'|trans }}
|
<i class="fa fa-pencil"></i> {{ 'Edit the activity'|trans }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{{ form(delete_form) }}
|
{# {{ form(delete_form) }} #}
|
||||||
{% endblock personcontent %}
|
{% endblock personcontent %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user