mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 06:14:59 +00:00
fix folder name
This commit is contained in:
BIN
src/Bundle/ChillReportBundle/Resources/test/Fixtures/.DS_Store
vendored
Normal file
BIN
src/Bundle/ChillReportBundle/Resources/test/Fixtures/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
|
||||
class AppKernel extends Kernel
|
||||
{
|
||||
public function registerBundles()
|
||||
{
|
||||
return array(
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new Chill\ReportBundle\ChillReportBundle(),
|
||||
new Symfony\Bundle\MonologBundle\MonologBundle(),
|
||||
new Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
new Chill\CustomFieldsBundle\ChillCustomFieldsBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Chill\MainBundle\ChillMainBundle(),
|
||||
new Chill\PersonBundle\ChillPersonBundle(),
|
||||
new \Symfony\Bundle\AsseticBundle\AsseticBundle(),
|
||||
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
|
||||
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle()
|
||||
);
|
||||
}
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCacheDir()
|
||||
{
|
||||
return sys_get_temp_dir().'/ChillReportBundle/cache';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLogDir()
|
||||
{
|
||||
return sys_get_temp_dir().'/ChillReportBundle/logs';
|
||||
}
|
||||
}
|
2
src/Bundle/ChillReportBundle/Resources/test/Fixtures/App/app/DoctrineMigrations/.gitignore
vendored
Normal file
2
src/Bundle/ChillReportBundle/Resources/test/Fixtures/App/app/DoctrineMigrations/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||
use Composer\Autoload\ClassLoader;
|
||||
|
||||
/** @var ClassLoader $loader */
|
||||
$loader = require __DIR__.'/../../../../../vendor/autoload.php';
|
||||
|
||||
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
|
||||
|
||||
return $loader;
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
imports:
|
||||
- { resource: parameters.yml }
|
||||
|
||||
framework:
|
||||
secret: Not very secret
|
||||
router: { resource: "%kernel.root_dir%/config/routing.yml" }
|
||||
form: true
|
||||
csrf_protection: true
|
||||
session: ~
|
||||
default_locale: fr
|
||||
translator: { fallback: fr }
|
||||
profiler: { only_exceptions: false }
|
||||
templating: #required for assetic. Remove if not needed
|
||||
engines: ['twig']
|
||||
|
||||
doctrine:
|
||||
dbal:
|
||||
driver: pdo_pgsql
|
||||
host: "%database_host%"
|
||||
port: "%database_port%"
|
||||
dbname: "%database_name%"
|
||||
user: "%database_user%"
|
||||
password: "%database_password%"
|
||||
charset: UTF8
|
||||
orm:
|
||||
auto_generate_proxy_classes: "%kernel.debug%"
|
||||
auto_mapping: true
|
||||
|
||||
# Assetic Configuration
|
||||
assetic:
|
||||
debug: "%kernel.debug%"
|
||||
use_controller: false
|
||||
bundles: [ ]
|
||||
#java: /usr/bin/java
|
||||
filters:
|
||||
cssrewrite: ~
|
||||
|
||||
chill_main:
|
||||
available_languages: [ fr, nl, en ]
|
||||
|
||||
security:
|
||||
providers:
|
||||
users:
|
||||
entity:
|
||||
class: Chill\MainBundle\Entity\User
|
||||
property: username
|
||||
|
||||
encoders:
|
||||
Chill\MainBundle\Entity\User:
|
||||
algorithm: bcrypt
|
||||
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
|
||||
|
||||
|
||||
default:
|
||||
anonymous: ~
|
||||
http_basic: ~
|
||||
form_login:
|
||||
csrf_parameter: _csrf_token
|
||||
csrf_token_id: authenticate
|
||||
csrf_provider: form.csrf_provider
|
||||
|
||||
logout: ~
|
||||
|
||||
|
||||
access_control:
|
||||
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: ^/admin, roles: ROLE_ADMIN }
|
||||
- { path: ^/, roles: ROLE_USER }
|
@@ -0,0 +1,7 @@
|
||||
imports:
|
||||
- { resource: config.yml } #here we import a config.yml file, this is not required
|
||||
|
||||
framework:
|
||||
test: ~
|
||||
session:
|
||||
storage_id: session.storage.filesystem
|
@@ -0,0 +1,7 @@
|
||||
imports:
|
||||
- { resource: config.yml } #here we import a config.yml file, this is not required
|
||||
|
||||
framework:
|
||||
test: ~
|
||||
session:
|
||||
storage_id: session.storage.filesystem
|
@@ -0,0 +1,7 @@
|
||||
parameters:
|
||||
database_host: chill__database
|
||||
database_port: 5432
|
||||
database_name: postgres
|
||||
database_user: postgres
|
||||
database_password: postgres
|
||||
locale: fr
|
@@ -0,0 +1,13 @@
|
||||
parameters:
|
||||
database_host: localhost
|
||||
# database_host: 127.0.0.1
|
||||
database_port: 5435
|
||||
# database_port: 5454
|
||||
database_name: postgres
|
||||
database_user: postgres
|
||||
database_password: postgres
|
||||
locale: fr
|
||||
secret: ThisTokenIsNotSoSecretChangeIt
|
||||
debug_toolbar: true
|
||||
debug_redirects: false
|
||||
use_assetic_controller: true
|
@@ -0,0 +1,7 @@
|
||||
parameters:
|
||||
database_host: 127.0.0.1
|
||||
database_port: 5432
|
||||
database_name: symfony
|
||||
database_user: symfony
|
||||
database_password: symfony
|
||||
locale: fr
|
@@ -0,0 +1,3 @@
|
||||
chill_routes:
|
||||
resource: .
|
||||
type: chill_routes
|
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Debug\Debug;
|
||||
|
||||
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
|
||||
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
|
||||
// for more information
|
||||
//umask(0000);
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
require __DIR__.'/autoload.php';
|
||||
|
||||
$input = new ArgvInput();
|
||||
$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
|
||||
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
|
||||
|
||||
if ($debug) {
|
||||
Debug::enable();
|
||||
}
|
||||
|
||||
$kernel = new AppKernel($env, $debug);
|
||||
$application = new Application($kernel);
|
||||
$application->run($input);
|
2
src/Bundle/ChillReportBundle/Resources/test/Fixtures/App/web/.gitignore
vendored
Normal file
2
src/Bundle/ChillReportBundle/Resources/test/Fixtures/App/web/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
@@ -0,0 +1,47 @@
|
||||
{#
|
||||
* 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/>.
|
||||
#}
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'report_select_type' %}
|
||||
|
||||
{% block title %}{{ 'Report edit' |trans }}{% endblock title %}
|
||||
|
||||
{% block personcontent %}
|
||||
{{ form_start(edit_form) }}
|
||||
|
||||
{{ form_row(edit_form.user) }}
|
||||
{{ form_row(edit_form.date) }}
|
||||
{{ form_row(edit_form.scope) }}
|
||||
{{ form_row(edit_form.cFData) }}
|
||||
|
||||
{{ form_widget(edit_form) }}
|
||||
<ul class="sticky-form-buttons record_actions">
|
||||
<li class="cancel">
|
||||
<a href="{{ path('report_list', { 'person_id': person.id } ) }}" class="sc-button bt-cancel">{{ 'Back to the list'|trans }}</a>
|
||||
<li>
|
||||
<li>
|
||||
<button class="sc-button bt-save" type="submit">{{ 'Save report'|trans }}</button>
|
||||
</li>
|
||||
</ul>
|
||||
{{ form_end(edit_form) }}
|
||||
{% 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 %}
|
@@ -0,0 +1,29 @@
|
||||
"{{ 'Report id'|trans }}",{#
|
||||
#}"{{ 'Person'|trans }}",{#
|
||||
#}"{{ 'Person id'|trans }}",{#
|
||||
#}"{{ 'Date'|trans }}",{#
|
||||
#}"{{ 'User'|trans }}",{#
|
||||
#}"{{ 'Report type'|trans }}",{#
|
||||
#}{% for customField in cf_group.activeCustomFields %}{#
|
||||
#}"{{ chill_custom_field_label(customField) }}"{% if not loop.last %},{% endif %}{#
|
||||
#}{% endfor %}{#
|
||||
|
||||
#}{{ '\r\n'|raw }}{#
|
||||
#}{% for report in reports %}{#
|
||||
#}{{ report.id }},{#
|
||||
#}"{{ report.person|csv_cell }}",{#
|
||||
#}"{{ report.person.id|csv_cell }}",{#
|
||||
#}"{{ report.date|format_date('short', 'none') }}",{#
|
||||
#}"{{ report.user|csv_cell }}",{#
|
||||
#}"{{ report.cFGroup.getName(app.request.locale)|csv_cell }}",{#
|
||||
#}{% for customField in report.cFGroup.activeCustomFields %}{#
|
||||
#}{% if customField.type == 'title' %}{#
|
||||
#}""{#
|
||||
#}{% else %}{#
|
||||
#}"{{ chill_custom_field_widget(report.cFData , customField, 'csv') }}"{#
|
||||
#}{% endif %}{#
|
||||
#}{% if not loop.last %},{% endif %}{#
|
||||
#}{% endfor %}{#
|
||||
|
||||
#}{{ '\r\n'|raw }}{#
|
||||
#}{% endfor %}
|
@@ -0,0 +1,80 @@
|
||||
{#
|
||||
* 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/>.
|
||||
#}
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'report_select_type' %}
|
||||
|
||||
{% block title %}{{ 'Report list' |trans }}{% endblock title %}
|
||||
|
||||
{% block personcontent %}
|
||||
|
||||
<h1>{{ 'Report list'|trans }}</h1>
|
||||
|
||||
{% if reports|length == 0 %}
|
||||
<p>
|
||||
<span class="chill-no-data-statement">{{ "No report registered for this person."|trans }}</span>
|
||||
</p>
|
||||
{% else %}
|
||||
<table class="" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="chill-red">{{ 'Date' | trans }}</th>
|
||||
<th class="chill-green">{{ 'Report type' | trans }}</th>
|
||||
<th class="chill-orange">{{ 'Circle' | trans }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for report in reports %}
|
||||
<tr>
|
||||
<td>{% if report.date %}{{ report.date|format_date('long') }}{% endif %}</td>
|
||||
<td>{{ report.cFGroup.getName|localize_translatable_string }}</td>
|
||||
<td>{{ report.scope.name|localize_translatable_string }}</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_REPORT_SEE', report) %}
|
||||
<li>
|
||||
<a href="{{ path('report_view', { 'person_id': report.person.id, 'report_id': report.id }) }}" class="sc-button bt-view"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if is_granted('CHILL_REPORT_UPDATE', report) %}
|
||||
<li>
|
||||
<a href="{{ path('report_edit', { 'person_id': report.person.id, 'report_id': report.id }) }}" class="sc-button bt-update"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if reports|length < paginator.getTotalItems %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('report_select_type', { 'person_id' : person.id } ) }}" class="sc-button bt-new">
|
||||
{{ 'Create a new report'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
@@ -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/>.
|
||||
#}
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'report_select_type' %}
|
||||
|
||||
{% block title %}{{ 'Add a report'|trans }}{% endblock title %}
|
||||
|
||||
{% block personcontent %}
|
||||
{{ form_start(form) }}
|
||||
|
||||
{{ form_row(form.user) }}
|
||||
{{ form_row(form.date) }}
|
||||
{{ form_row(form.scope) }}
|
||||
{{ form_row(form.cFData) }}
|
||||
<ul class="sticky-form-buttons record_actions">
|
||||
<li class="cancel">
|
||||
<a href="{{ path('report_list', { 'person_id': person.id } ) }}" class="sc-button bt-cancel">{{ 'Back to the list'|trans }}</a>
|
||||
<li>
|
||||
<li>
|
||||
<button class="sc-button bt-create" type="submit"> {{ 'Add report'|trans }}</button>
|
||||
</li>
|
||||
</ul>
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% 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 %}
|
@@ -0,0 +1,40 @@
|
||||
{#
|
||||
* 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/>.
|
||||
#}
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'report_select_type' %}
|
||||
|
||||
{% block title %}{{ 'Add a report'|trans() }}{% endblock title %}
|
||||
|
||||
{% block personcontent %}
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form.cFGroup) }}
|
||||
|
||||
<ul class="record_actions">
|
||||
<li class="cancel">
|
||||
<a href="{{ path('report_list', { 'person_id': person.id } ) }}" class="sc-button bt-cancel">{{ 'Back to the list'|trans }}</a>
|
||||
<li>
|
||||
<button class="sc-button green" type="submit">
|
||||
<i class="fa fa-plus"></i>
|
||||
{{ 'Create a new report'|trans }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
{{ form_end(form) }}
|
||||
|
||||
{% endblock %}
|
@@ -0,0 +1,33 @@
|
||||
{#
|
||||
* 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/>.
|
||||
#}
|
||||
{% extends "@ChillMain/Export/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'report_export_list' %}
|
||||
|
||||
{% block title %}{{ 'Reports export'|trans() }}{% endblock title %}
|
||||
|
||||
{% block export_content %}
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form.cFGroup) }}
|
||||
<button class="sc-button green" type="submit">
|
||||
<i class="fa fa-upload"></i>
|
||||
{{ 'Export this kind of reports'|trans }}
|
||||
</button>
|
||||
{{ form_end(form) }}
|
||||
|
||||
{% endblock %}
|
@@ -0,0 +1,57 @@
|
||||
{#
|
||||
* 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/>.
|
||||
#}
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'report_select_type' %}
|
||||
|
||||
{% block title %}{{ 'Report view' |trans() }}{% endblock title %}
|
||||
|
||||
{% block personcontent %}
|
||||
|
||||
<h1>{{ 'Report view : %name%' | trans({ '%name%' : entity.cFGroup.getName|localize_translatable_string } ) }}</h1>
|
||||
|
||||
<h2 class="chill-red">{{ 'Details'|trans }}</h2>
|
||||
|
||||
<dl>
|
||||
<dt>{{ 'Person'|trans }} :</dt>
|
||||
<dd>{{ entity.person }}</dd>
|
||||
<dt>{{ 'Circle'|trans }} :</dt>
|
||||
<dd><span class="scope circle">{{ entity.scope.name|localize_translatable_string }}</span></dd>
|
||||
<dt>{{ 'Date'|trans }} :</dt>
|
||||
<dd>{{ entity.date|format_date('long') }}</dd>
|
||||
<dt>{{ 'User'|trans }} :</dt>
|
||||
<dd>{{ entity.user }}</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
<h2 class="chill-red">{{ 'Report data'|trans }}</h2>
|
||||
|
||||
<dl class="chill_report_view_data">
|
||||
{{ chill_custom_fields_group_widget(entity.cFData, entity.cFGroup) }}
|
||||
</dl>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li class="cancel">
|
||||
<a href="{{ path('report_list', { 'person_id': person.id } ) }}" class="sc-button bt-cancel">{{ 'Back to the list'|trans }}</a>
|
||||
<li>
|
||||
{% if is_granted('CHILL_REPORT_UPDATE', entity) %}
|
||||
<li>
|
||||
<a class="sc-button bt-edit" href="{{ path('report_edit', { 'person_id': entity.person.id, 'report_id': entity.id }) }}">{{ 'Update the report' | trans }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endblock %}
|
@@ -0,0 +1,46 @@
|
||||
{#
|
||||
* 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>{{ 'Scope'|trans }}</th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for report in reports %}
|
||||
<tr>
|
||||
<td>{{ report.person }}</td>
|
||||
<td>{% if report.date %}{{ report.date|format_date('long') }}{% endif %}</td>
|
||||
<td>{{ report.cFGroup.getName|localize_translatable_string }}</td>
|
||||
<td>{{ report.scope.name|localize_translatable_string }}</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 %}
|
@@ -0,0 +1,40 @@
|
||||
<div class="report_entry">
|
||||
<h3>{{ report.date|format_date('long') }}<span class="report"> / {{ 'Report'|trans }}</span></h3>
|
||||
<div class="statement">
|
||||
<span class="statement">{{ '%user% has filled a %report_label% report'|trans(
|
||||
{
|
||||
'%user%' : user,
|
||||
'%report_label%': report.CFGroup.name|localize_translatable_string,
|
||||
'%date%' : report.date|format_date('long') }
|
||||
) }}</span>
|
||||
</div>
|
||||
{% if custom_fields_in_summary|length > 0 %}
|
||||
<div class="summary">
|
||||
<dl class="chill_report_view_data timeline">
|
||||
{% for field in custom_fields_in_summary %}
|
||||
{% if field.type == 'title' %}
|
||||
{{ chill_custom_field_widget(report.cFData, field) }}
|
||||
{% else %}
|
||||
<dt>{{ chill_custom_field_label(field) }}</dt>
|
||||
<dd>{{ chill_custom_field_widget(report.cFData, field) }}</dd>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</dl>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('report_view', { 'person_id': person.id, 'report_id': report.id} ) }}" class="sc-button bt-view">
|
||||
{{ 'View the report'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% if is_granted('CHILL_REPORT_UPDATE', report) %}
|
||||
<li>
|
||||
<a href="{{ path('report_edit', { 'person_id': person.id, 'report_id': report.id} ) }}" class="sc-button bt-edit">
|
||||
{{ 'Update the report'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
Reference in New Issue
Block a user