Merge remote-tracking branch 'origin/master'

This commit is contained in:
Julien Fastré 2018-04-30 17:40:33 +02:00
commit 57169b3148
12 changed files with 220 additions and 50 deletions

View File

@ -33,26 +33,29 @@ class SingleTaskController extends Controller
public function newAction(Request $request)
{
$personId = $request->query->getInt('person_id', null);
$task = (new SingleTask())
->setAssignee($this->getUser())
->setType('task_default')
;
if ($personId === null) {
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
if ($request->query->has('person_id')) {
$personId = $request->query->getInt('person_id', null);
if ($personId === null) {
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
}
$person = $this->getDoctrine()->getManager()
->getRepository(Person::class)
->find($personId);
if ($person === null) {
$this->createNotFoundException("Invalid person id");
}
$task->setPerson($person);
}
$person = $this->getDoctrine()->getManager()
->getRepository(Person::class)
->find($personId);
if ($person === null) {
$this->createNotFoundException("Invalid person id");
}
$task = (new SingleTask())
->setAssignee($this->getUser())
->setPerson($person)
->setType('task_default')
;
$this->denyAccessUnlessGranted(TaskVoter::CREATE, $task, 'You are not '
. 'allowed to create this task');
@ -69,7 +72,7 @@ class SingleTaskController extends Controller
$this->addFlash('success', "The task is created");
return $this->redirectToRoute('chill_task_task_list_by_person', [
return $this->redirectToRoute('chill_task_singletask_list', [
'person_id' => $task->getPerson()->getId()
]);

View File

@ -1,12 +1,82 @@
@import '../../../../main/Resources/public/sass/custom/config/colors';
div#single_task_warningInterval {
display: flex;
flex-direction: row;
justify-content: flex-end;
div.container {
display: flex;
flex-direction: row;
justify-content: flex-end;
& > div:first-child {
display:none; /* Hide the label container */
}
& > div {
padding-right: 0;
width: 7em;
}
input[type="text"] {
height: 35px;
}
}
}
.bt-task-label {
display: inline-flex;
margin-bottom: 0.2em;
font-size: 0.8em;
text-transform: capitalize;
}
.bt-task {
display: block;
height: 0;
width: 8px;
padding-right: 3px;;
}
.bt-task-exchange {
background: $chill-green;
}
.bt-task-exchange:hover {
background: $chill-green-dark;
}
.bt-task-exchange::before {
@extend .bt-task;
width: 10px;
content: url(../svg/exchange-alt.svg);
}
.bt-task-start::before {
@extend .bt-task;
content: url(../svg/play.svg);
}
.bt-task-cancel::before {
content: url(../svg/times.svg);
@extend .bt-task;
content: url(../svg/archive.svg);
}
.bt-task-close::before {
content: url(../svg/stop.svg);
@extend .bt-task;
content: url(../svg/check.svg);
}
.bt-dropdown {
position: relative;
display: inline-block;
}
.bt-dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
padding: 0.4em 0.7em;
z-index: 1;
}
.bt-dropdown:hover .bt-dropdown-content {
display: block;
}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M32 448c0 17.7 14.3 32 32 32h384c17.7 0 32-14.3 32-32V160H32v288zm160-212c0-6.6 5.4-12 12-12h104c6.6 0 12 5.4 12 12v8c0 6.6-5.4 12-12 12H204c-6.6 0-12-5.4-12-12v-8zM480 32H32C14.3 32 0 46.3 0 64v48c0 8.8 7.2 16 16 16h480c8.8 0 16-7.2 16-16V64c0-17.7-14.3-32-32-32z"/></svg>

After

Width:  |  Height:  |  Size: 344 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"/></svg>

After

Width:  |  Height:  |  Size: 354 B

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 512 512"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="exchange-alt.svg">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1313"
inkscape:window-height="744"
id="namedview6"
showgrid="false"
inkscape:zoom="0.4609375"
inkscape:cx="256"
inkscape:cy="256"
inkscape:window-x="53"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<path
d="M0 168v-16c0-13.255 10.745-24 24-24h360V80c0-21.367 25.899-32.042 40.971-16.971l80 80c9.372 9.373 9.372 24.569 0 33.941l-80 80C409.956 271.982 384 261.456 384 240v-48H24c-13.255 0-24-10.745-24-24zm488 152H128v-48c0-21.314-25.862-32.08-40.971-16.971l-80 80c-9.372 9.373-9.372 24.569 0 33.941l80 80C102.057 463.997 128 453.437 128 432v-48h360c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24z"
id="path4"
style="fill:#ffffff;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"/></svg>

Before

Width:  |  Height:  |  Size: 185 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M323.1 441l53.9-53.9c9.4-9.4 9.4-24.5 0-33.9L279.8 256l97.2-97.2c9.4-9.4 9.4-24.5 0-33.9L323.1 71c-9.4-9.4-24.5-9.4-33.9 0L192 168.2 94.8 71c-9.4-9.4-24.5-9.4-33.9 0L7 124.9c-9.4 9.4-9.4 24.5 0 33.9l97.2 97.2L7 353.2c-9.4 9.4-9.4 24.5 0 33.9L60.9 441c9.4 9.4 24.5 9.4 33.9 0l97.2-97.2 97.2 97.2c9.3 9.3 24.5 9.3 33.9 0z"/></svg>

Before

Width:  |  Height:  |  Size: 399 B

View File

@ -26,9 +26,9 @@ User: Utilisateur
'Task start date': 'Date de début'
'Task warning date': "Date d'avertissement"
'Task end date': "Date d'échéance"
'Start: ': 'Début: '
'Warning: ': 'Avertissement: '
'End: ': 'Échéance: '
'Start': 'Début: '
'Warning': 'Avertissement: '
'End': 'Échéance: '
'Task type': 'Type'
'Task status': 'Statut'
'Edit the task': 'Éditer la tâche'
@ -39,14 +39,26 @@ User: Utilisateur
'Remove task': 'Supprimer la tâche'
'Are you sure you want to remove the task about "%name%" ?': 'Êtes-vous sûr·e de vouloir supprimer la tâche de "%name%"?'
'See more': 'Voir plus'
Associated tasks: Tâches associées
My tasks: Mes tâches
'Associated tasks': 'Tâches associées'
'My tasks': 'Mes tâches'
'No description': 'Pas de description'
'No dates specified': 'Dates non spécifiées'
'No one assignee': 'Aucune personne assignée'
Days: Jour(s)
Weeks: Semaine(s)
Months: Mois
Year: Année(s)
# transitions
'new': 'nouvelle'
'in_progress': 'en cours'
'closed': 'fermée'
'canceled': 'supprimée'
start: démarrer
close: clotûrer
cancel: annuler
#Flash messages
'The task is created': 'La tâche a été créée'

View File

@ -1 +1,2 @@
The start date must be before the end date: La date de début doit être avant la date de fin
The start date must be before the end date: La date de début doit être avant la date de fin
This form contains errors: Le formulaire contient des erreurs

View File

@ -26,29 +26,25 @@
{% for place in workflow_marked_places(task) %}
<span class="">{{ place|trans }}</span>
{% endfor %}
{% for transition in workflow_transitions(task) %}
<a href="{{ path('chill_task_task_transition', { 'taskId': task.id, 'transition': transition.name|trans, 'kind': 'single-task', 'return_path': app.request.uri }) }}" class="{{ task_workflow_metadata(task, 'transition.class', transition)|e('html_attr') }}">{{ task_workflow_metadata(task, 'transition.verb', transition) }}</a>
{% endfor %}
</td>
<td>
{% if task.startDate is null and task.warningDate is null and task.endDate is null %}
{{'Unknown dates'|trans}}
{{'No dates specified'|trans}}
{% else %}
<ul class="record_actions_column">
<li>
{% if task.startDate is not null %}
{{'Start: '|trans}}{{ task.startDate|localizeddate('medium', 'none') }}
{{'Start'|trans}}&nbsp;:{{ task.startDate|localizeddate('medium', 'none') }}
{% endif %}
</li>
<li>
{% if task.warningDate is not null %}
{{'Warning: '|trans}}{{ task.warningDate|localizeddate('medium', 'none') }}
{{'Warning'|trans}}&nbsp;:{{ task.warningDate|localizeddate('medium', 'none') }}
{% endif %}
</li>
<li>
{% if task.endDate is not null %}
{{'End: '|trans}}{{ task.endDate|localizeddate('medium', 'none') }}
{{'End'|trans}}&nbsp;:{{ task.endDate|localizeddate('medium', 'none') }}
{% endif %}
</li>
</ul>
@ -56,6 +52,16 @@
</td>
<td>
<ul class="record_actions">
<li>
<div class="bt-dropdown">
<a href="" class="sc-button bt-task-exchange">&nbsp;</a>
<div class="bt-dropdown-content">
{% for transition in workflow_transitions(task) %}
<a href="{{ path('chill_task_task_transition', { 'taskId': task.id, 'transition': transition.name|trans, 'kind': 'single-task', 'return_path': app.request.uri }) }}" class="{{ task_workflow_metadata(task, 'transition.class', transition)|e('html_attr') }}">{{ task_workflow_metadata(task, 'transition.verb', transition)|trans }}</a>
{% endfor %}
</div>
</div>
</li>
<li>
<a href="{{ path('chill_task_single_task_show', { 'id': task.id }) }}" class="sc-button bt-show "></a>
</li>

View File

@ -25,32 +25,58 @@
{% block personcontent %}
<h1 class="chill-red">{{ 'Task'|trans }}</h1>
<h2>{{ task.title }}</h2>
<dl class="chill_view_data">
<dt class="inline">{{ 'Title'|trans }}</dt>
<dd>{{ task.title }}</dd>
<dt class="inline">{{ 'Description'|trans }}</dt>
<dd>{{ task.description }}</dd>
<dd>
{% if task.description is empty %}
<span class="chill-no-data-statement">{{"No description"|trans}}</span>
{% else %}
{{ task.description }}
{% endif %}
</dd>
<dt class="inline">{{ 'Assignee'|trans }}</dt>
<dd>{{ task.assignee }}</dd>
<dd>
{% if task.assignee is null %}
<span class="chill-no-data-statement">{{"No one assignee"|trans}}</span>
{% else %}
{{ task.assignee }}
{% endif %}
</dd>
<dt class="inline">{{ 'Scope'|trans }}</dt>
<dd><span class="scope">{{ task.scope.name|localize_translatable_string }}</span></dd>
<dt class="inline">{{ 'Start date'|trans }}</dt>
<dd>{{ task.startDate|localizeddate('long', 'none') }}</dd>
<h3>{{"Dates"|trans}}</h3>
{% if task.startDate is null and task.endDate is null and task.warningDate is null %}
<dt>
<dd><span class="chill-no-data-statement">{{"No dates specified"|trans}}</span></dd>
</dt>
{% else %}
{% if task.startDate is not null %}
<dt class="inline">{{ 'Start'|trans }}</dt>
<dd>{{ task.startDate|localizeddate('long', 'none') }}</dd>
{% endif %}
<dt class="inline">{{ 'End date'|trans }}</dt>
<dd>{{ task.endDate|localizeddate('long', 'none') }}</dd>
{% if task.endDate is not null %}
<dt class="inline">{{ 'End'|trans }}</dt>
<dd>{{ task.endDate|localizeddate('long', 'none') }}</dd>
{% endif %}
<dt class="inline">{{ 'Warning date'|trans }}</dt>
<dd>{{ task.warningDate|localizeddate('long', 'none') }}</dd>
{% if task.warningDate is not null %}
<dt class="inline">{{ 'Warning'|trans }}</dt>
<dd>{{ task.warningDate|localizeddate('long', 'none') }}</dd>
{% endif %}
{% endif %}
</dl>
<ul class="record_actions">
<li class="cancel">
<a class="sc-button bt-cancel" href="{{ path('chill_task_task_list_by_person', { 'personId': person.id } ) }}">
<a class="sc-button bt-cancel" href="{{ path('chill_task_singletask_list', { 'person_id': person.id } ) }}">
{{ 'Back to the list'|trans }}
</a>
</li>

View File

@ -31,15 +31,15 @@ class DefaultTaskDefinition implements \Chill\TaskBundle\Workflow\TaskWorkflowDe
const TRANSITION_METADATA = [
'close' => [
'verb' => 'close',
'class' => 'sc-button bt-task-close'
'class' => 'sc-button bt-task-label bt-task-close'
],
'cancel' => [
'verb' => 'cancel',
'class' => 'sc-button bt-task-cancel'
'class' => 'sc-button bt-task-label bt-task-cancel'
],
'start' => [
'verb' => 'start',
'class' => 'sc-button bt-task-start'
'class' => 'sc-button bt-task-label bt-task-start'
]
];