Add report search feature

refs #377
This commit is contained in:
2015-01-06 21:23:45 +01:00
parent 2d19125dcf
commit 3efda954be
5 changed files with 300 additions and 2 deletions

View File

@@ -6,4 +6,13 @@ services:
chill.report.routing_loader:
class: Chill\ReportBundle\Routing\RoutesLoader
tags:
- { name: routing.loader }
- { name: routing.loader }
chill.report.search:
class: Chill\ReportBundle\Search\ReportSearch
arguments:
- '@doctrine.orm.entity_manager'
calls:
- [setContainer, ["@service_container"]]
tags:
- { name: chill.search, alias: 'report' }

View File

@@ -26,4 +26,10 @@ User: Utilisateur
'Unable to find this report.': Rapport introuvable.
'This is not the report of the person.': "La personne et le rapport sélectionnés ne sont pas associés"
'You are going to leave a page with unsubmitted data. Are you sure you want to leave ?': "Vous allez quitter la page alors que des données n'ont pas été enregistrées. Êtes vous sûr de vouloir partir ?"
'You are going to leave a page with unsubmitted data. Are you sure you want to leave ?': "Vous allez quitter la page alors que des données n'ont pas été enregistrées. Êtes vous sûr de vouloir partir ?"
#search
'You may not set a date argument and a date in default': Vous avez introduit deux dates, l'une avec l'argument date et l'autre en zone de recherche par défaut. Merci d'indiquer l'un ou l'autre
'You must provide either a date:YYYY-mm-dd argument or a YYYY-mm-dd default search': Merci d'indiquer soit un argument date:YYYY-mm-dd, soit une date dans la recherche par défaut.
'Reports search results': Recherche dans les rapports
'%total% reports matching the search "%pattern%"': '{0} Aucun rapport ne correspond à la recherche "%pattern%" | {1} Un rapport correspond à la recherche "%pattern%" | ]1,Inf]%total% rapports correspondent à la recherche "%pattern%"'

View File

@@ -0,0 +1,45 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* 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/>.
#}
<h2>{{ 'Reports search results'|trans }}</h2>
<p>{{ '%total% reports matching the search "%pattern%"'|transchoice( total, {'%pattern%': pattern, '%total%' : total}) }}</p>
{% if reports|length > 0 %}
<table class="striped rounded">
<thead>
<tr>
<th>{{ 'Person'|trans }}</th>
<th>{{ 'Date'|trans }}</th>
<th>{{ 'Report type'|trans }}</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for report in reports %}
<tr>
<td>{{ report.person }}</td>
<td>{% if report.date %}{{ report.date|date('d-m-Y') }}{% endif %}</td>
<td>{{ report.cFGroup.getName|localize_translatable_string }}</td>
<!-- <td>{{ report.scope }}</td> -->
<td><a href="{{ path('report_view', { 'person_id': report.person.id, 'report_id': report.id }) }}">{{ 'View the report' | trans }}</a></td>
<td><a href="{{ path('report_edit', { 'person_id': report.person.id, 'report_id': report.id }) }}">{{ 'Update the report' | trans }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}