Commit 32c0bc46 by Julien Jorry

Add author on composer + Add PWA support + fix error with global conf + fix bug…

Add author on composer + Add PWA support + fix error with global conf + fix bug with install + fix bug with menu + fix bug with comptoir controller
parent 7541d056
{ {
"type": "project", "type": "project",
"license": "proprietary", "homepage": "https://www.kohinos.com",
"description": "Kohinos : Outil de gestion de monnaie locale complémentaire",
"license": "AGPLv3",
"authors": [
{
"name": "Julien Jorry",
"email": "julien.jorry@gmail.com",
"homepage": "https://www.malt.fr/profile/julienjorry"
}
],
"require": { "require": {
"php": "^7.1.3", "php": "^7.1.3",
"ext-ctype": "*", "ext-ctype": "*",
......
{"name":"Kohinos","short_name":"Kohinos","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} {
\ No newline at end of file "lang" : "fr",
"dir" : "ltr",
"name" : "Kohinos : Outil de gestion de MLCC",
"short_name" : "kohinos",
"icons" : [
{
"src" : "/images/favicon/android-chrome-192x192.png",
"sizes" : "192x192",
"type" : "image/png"
},
{
"src" : "/images/favicon/android-chrome-144x144.png",
"sizes" : "144x144",
"type" : "image/png"
},
{
"src" : "/images/favicon/android-chrome-96x96.png",
"sizes" : "96x96",
"type" : "image/png"
},
{
"src" : "/images/favicon/android-chrome-48x48.png",
"sizes" : "48x48",
"type" : "image/png"
}
],
"theme_color" : "#ffffff",
"background_color" : "#ffffff",
"start_url" : "/",
"display" : "standalone",
"orientation" : "natural"
}
\ No newline at end of file
self.addEventListener('fetch', function(event) {});
\ No newline at end of file
...@@ -21,4 +21,4 @@ class ApplicationSonataMediaBundle extends Bundle ...@@ -21,4 +21,4 @@ class ApplicationSonataMediaBundle extends Bundle
{ {
return 'SonataMediaBundle'; return 'SonataMediaBundle';
} }
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ class Gallery extends BaseGallery ...@@ -28,4 +28,4 @@ class Gallery extends BaseGallery
{ {
return $this->id; return $this->id;
} }
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ class Media extends BaseMedia ...@@ -28,4 +28,4 @@ class Media extends BaseMedia
{ {
return $this->id; return $this->id;
} }
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ class Gallery extends BaseGallery ...@@ -28,4 +28,4 @@ class Gallery extends BaseGallery
{ {
return $this->id; return $this->id;
} }
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ class GalleryHasMedia extends BaseGalleryHasMedia ...@@ -28,4 +28,4 @@ class GalleryHasMedia extends BaseGalleryHasMedia
{ {
return $this->id; return $this->id;
} }
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ class Media extends BaseMedia ...@@ -28,4 +28,4 @@ class Media extends BaseMedia
{ {
return $this->id; return $this->id;
} }
} }
\ No newline at end of file
...@@ -21,4 +21,4 @@ class ApplicationSonataUserBundle extends Bundle ...@@ -21,4 +21,4 @@ class ApplicationSonataUserBundle extends Bundle
{ {
return 'SonataUserBundle'; return 'SonataUserBundle';
} }
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ class Group extends BaseGroup ...@@ -28,4 +28,4 @@ class Group extends BaseGroup
{ {
return $this->id; return $this->id;
} }
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ class User extends BaseUser ...@@ -28,4 +28,4 @@ class User extends BaseUser
{ {
return $this->id; return $this->id;
} }
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ use Symfony\Component\Routing\Annotation\Route; ...@@ -8,7 +8,7 @@ use Symfony\Component\Routing\Annotation\Route;
class ComptoirController extends FrontController class ComptoirController extends FrontController
{ {
private $em; protected $em;
public function __construct(EntityManagerInterface $em) public function __construct(EntityManagerInterface $em)
{ {
......
<?php <?php
namespace App\DQL namespace App\DQL;
;
use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Lexer;
......
...@@ -68,4 +68,4 @@ class UserListener implements EventSubscriberInterface ...@@ -68,4 +68,4 @@ class UserListener implements EventSubscriberInterface
{ {
// @TODO : notification ? // @TODO : notification ?
} }
} }
\ No newline at end of file
...@@ -10,5 +10,4 @@ namespace App\Exception; ...@@ -10,5 +10,4 @@ namespace App\Exception;
*/ */
class BadRequestDataException extends \Exception class BadRequestDataException extends \Exception
{ {
} }
...@@ -49,10 +49,10 @@ class CotisationInfosFormType extends FluxFormType ...@@ -49,10 +49,10 @@ class CotisationInfosFormType extends FluxFormType
'html5' => false, 'html5' => false,
'attr' => ['class' => 'js-datepicker'], 'attr' => ['class' => 'js-datepicker'],
)); ));
if ($this->security->getUser() != null && $this->security->getUser()->isGranted('ROLE_TRESORIER') ) { if ($this->security->getUser() != null && $this->security->getUser()->isGranted('ROLE_TRESORIER')) {
$builder $builder
->add('recu', CheckboxType::class, array('label' => 'Reçu')); ->add('recu', CheckboxType::class, array('label' => 'Reçu'));
} }
; ;
} }
......
...@@ -107,6 +107,7 @@ class GlobalConfigurationFormType extends AbstractType ...@@ -107,6 +107,7 @@ class GlobalConfigurationFormType extends AbstractType
new RegexConstraint(['pattern' => '/^[1-9]$|^1[0-9]$/', 'message' => 'Le zoom doit être un nombre entre 1 et 19, généralement entre 9 et 15 pour les MLC !']) new RegexConstraint(['pattern' => '/^[1-9]$|^1[0-9]$/', 'message' => 'Le zoom doit être un nombre entre 1 et 19, généralement entre 9 et 15 pour les MLC !'])
], ],
)) ))
// @TODO : checkbox au lieu de texttype pour certains paramètres globaux
->add('usewordpress', GlobalParameterType::class, array( ->add('usewordpress', GlobalParameterType::class, array(
'label' => "Utiliser Wordpress pour le site web :", 'label' => "Utiliser Wordpress pour le site web :",
'name_param' => GlobalParameter::USE_WORDPRESS, 'name_param' => GlobalParameter::USE_WORDPRESS,
......
...@@ -62,7 +62,6 @@ class VoterSecurityHandler extends RoleSecurityHandler ...@@ -62,7 +62,6 @@ class VoterSecurityHandler extends RoleSecurityHandler
private function isAnyGranted(array $attributes, $subject = null): bool private function isAnyGranted(array $attributes, $subject = null): bool
{ {
// $user = $this->tokenStorageInterface->getToken()->getUser();
foreach ($attributes as $attribute) { foreach ($attributes as $attribute) {
if ($this->authorizationChecker->isGranted($attribute, $subject)) { if ($this->authorizationChecker->isGranted($attribute, $subject)) {
return true; return true;
......
...@@ -18,6 +18,16 @@ class MlcGlobalsExtension extends AbstractExtension implements GlobalsInterface ...@@ -18,6 +18,16 @@ class MlcGlobalsExtension extends AbstractExtension implements GlobalsInterface
public function getGlobals() public function getGlobals()
{ {
return $this->em->getRepository(GlobalParameter::class)->findAllByName(); $arrayGlobals = $this->em->getRepository(GlobalParameter::class)->findAllByName();
// @TODO : Better default param if not exist
if (!isset($arrayGlobals['KOH_MAP_CENTER'])) {
$arrayGlobals['KOH_MAP_CENTER'] = '[46.898,3.230]';
}
if (!isset($arrayGlobals['KOH_MAP_ZOOM'])) {
$arrayGlobals['KOH_MAP_ZOOM'] = '6';
}
return $arrayGlobals;
} }
} }
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
{% endif %} {% endif %}
{{ form_row(form.geoloc) }} {{ form_row(form.geoloc) }}
<div class='text-center mb-5 mt-2'> <div class='text-center mb-5 mt-2'>
<h5>{{ 'Montant de la cotisation'|trans }} : <b>{{ KOH_COTISATION_ADHERENT }}</b></h5> <h5>{{ 'Montant de la cotisation'|trans }} : <b>{{ KOH_COTISATION_ADHERENT|default('') }}</b></h5>
{{ form_row(form.save) }} {{ form_row(form.save) }}
</div> </div>
{{form_end(form)}} {{form_end(form)}}
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
<h3 class="box-title">{{ 'GLOBAL'|trans }}</h3> <h3 class="box-title">{{ 'GLOBAL'|trans }}</h3>
</div> </div>
<div class="box-body"> <div class="box-body">
<h4>Solde de MLC en circulation : 12345 {{KOH_MLC_NAME_SMALL}}</h4> <h4>Solde de MLC en circulation : 12345 {{KOH_MLC_NAME_SMALL|default('') }}</h4>
<h4>Solde de Monnaie Nantie : 12345 {{KOH_MLC_NAME_SMALL}}</h4> <h4>Solde de Monnaie Nantie : 12345 {{KOH_MLC_NAME_SMALL|default('') }}</h4>
</div> </div>
</div> </div>
......
<header class="container header"> <header class="container header">
<nav class="menu navbar navbar-expand-md navbar-light bg-light"> <nav class="menu navbar navbar-expand-md navbar-light bg-light">
<a class="navbar-brand" href="{{ url('index') }}"> <a class="navbar-brand" href="{{ url('index') }}">
<img src="/images/logo.png" height="45" class="d-inline-block align-top" alt="{{KOH_MLC_NAME is defined ? KOH_MLC_NAME : ''}}"> <img src="/images/logo.png" height="45" class="d-inline-block align-top" alt="{{ KOH_MLC_NAME|default('') }}">
</a> </a>
{% block menu %} {% block menu %}
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
<title>{{title|default('Kohinos') }}</title> <title>{{title|default('Kohinos') }}</title>
<meta name="description" content="{{ description|default('Kohinos : Outil de gestion de monnaie locale complémentaire') }}" /> <meta name="description" content="{{ description|default('Kohinos : Outil de gestion de monnaie locale complémentaire') }}" />
<meta name="keywords" content="{{ keywords|default('Kohinos, mlc, mlcc, monnaie locale, monnaies locales') }}" /> <meta name="keywords" content="{{ keywords|default('Kohinos, mlc, mlcc, monnaie locale, monnaies locales') }}" />
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
{# FAVICON #} {# FAVICON #}
{% block favicon %} {% block favicon %}
...@@ -72,6 +74,18 @@ ...@@ -72,6 +74,18 @@
$('#roleGroupeModal').modal('show'); $('#roleGroupeModal').modal('show');
}); });
</script> </script>
{# https://stackoverflow.com/questions/34369951/how-to-get-add-to-home-screen-pop-up-on-site-open-in-mobile-browser #}
<script>
if ('serviceWorker' in navigator) {
console.log("Will the service worker register?");
navigator.serviceWorker.register('js/service-worker.js')
.then(function(reg){
console.log("Yes, it did.");
}).catch(function(err) {
console.log("No it didn't. This happened:", err)
});
}
</script>
</body> </body>
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
</div> </div>
</li> </li>
{% endif %} {% endif %}
{% if KOH_USE_WORDPRESS is not defined %}
{% set KOH_USE_WORDPRESS = true %}
{% endif %}
{% if KOH_USE_WORDPRESS == 'false' and menuItems is not null and menuItems|length > 0 %} {% if KOH_USE_WORDPRESS == 'false' and menuItems is not null and menuItems|length > 0 %}
{% import 'common/menu_tree_macro.html.twig' as tree %} {% import 'common/menu_tree_macro.html.twig' as tree %}
{% set currentPath = app.request.requestUri %} {% set currentPath = app.request.requestUri %}
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
</p> </p>
{# @TODO (pas prioritaire) : Statistiques avancées : {# @TODO (pas prioritaire) : Statistiques avancées :
<p> <p>
<i class="fa fa-check"> </i> 527029 {{ KOH_MLC_NAME_SMALL }} émises <i class="fa fa-check"> </i> 527029 {{ KOH_MLC_NAME_SMALL|default('') }} émises
</p> </p>
<p> <p>
<i class="fa fa-check"> </i> 350304 {{ KOH_MLC_NAME_SMALL }} reconverties <i class="fa fa-check"> </i> 350304 {{ KOH_MLC_NAME_SMALL|default('') }} reconverties
</p> </p>
<p> <p>
<i class="fa fa-check"> </i> 174778 {{ KOH_MLC_NAME_SMALL }} en circulation <i class="fa fa-check"> </i> 174778 {{ KOH_MLC_NAME_SMALL|default('') }} en circulation
</p> </p>
<p> <p>
<i class="fa fa-check"> </i> 192923 d'échanges numériques <i class="fa fa-check"> </i> 192923 d'échanges numériques
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
<div class='text-center mb-5'> <div class='text-center mb-5'>
{% if isCurrentRoleGranted('ROLE_ADHERENT') %} {% if isCurrentRoleGranted('ROLE_ADHERENT') %}
<h4>{{ 'Solde de eMLC'|trans }} : <b>{{ app.user.adherent.ecompte }}</b></h4> <h4>{{ 'Solde de eMLC'|trans }} : <b>{{ app.user.adherent.ecompte }}</b></h4>
<h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_ADHERENT }}</b></h5> <h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_ADHERENT|default('') }}</b></h5>
{% elseif isCurrentRoleGranted('ROLE_PRESTATAIRE') %} {% elseif isCurrentRoleGranted('ROLE_PRESTATAIRE') %}
<h4>{{ 'Solde de eMLC'|trans }} : <b>{{ app.session.get('_prestagere').ecompte }}</b></h4> <h4>{{ 'Solde de eMLC'|trans }} : <b>{{ app.session.get('_prestagere').ecompte }}</b></h4>
<h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_PRESTATAIRE }}</b></h5> <h5>{{ 'Montant minimum de la cotisation'|trans }} : <b>{{ KOH_COTISATION_PRESTATAIRE|default('') }}</b></h5>
{% endif %} {% endif %}
</h5> </h5>
{{ form_start(form) }} {{ form_start(form) }}
......
...@@ -5,6 +5,15 @@ ...@@ -5,6 +5,15 @@
<div class='row mt-3'> <div class='row mt-3'>
<div class='col-12 text-center'> <div class='col-12 text-center'>
{% block colonne_centre %} {% block colonne_centre %}
{% if app.user is null %}
{% set modal_id = 'mlcloginmodal' %}
{% set modal_title = 'Se connecter'|trans %}
{% set modal_content %}
{% include 'common/login.html.twig' %}
{% endset %}
{% include 'block/modal.html.twig' %}
<a class='btn btn-primary w-100 mb-4' data-toggle="modal" data-target="#{{ modal_id }}" title='{{ 'Se connecter'|trans }}' href="{{path('fos_user_security_login')}}">{{ 'Se connecter'|trans }}</a>
{% endif %}
{% include 'block/useradmin.html.twig' %} {% include 'block/useradmin.html.twig' %}
{% endblock colonne_centre %} {% endblock colonne_centre %}
</div> </div>
......
{% extends 'common/layout.html.twig' %} {% extends 'common/layout.html.twig' %}
{% form_theme form _self %} {% form_theme form _self %}
{% block menu %}
{% endblock menu %}
{% block content %} {% block content %}
<div class='container homepage'> <div class='container homepage'>
<div class="card mx-auto mt-5" style="max-width: 600px;"> <div class="card mx-auto mt-5" style="max-width: 600px;">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{% endblock blocktitle %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
<p>{{'Solde de votre compte'|trans}} : {{ app.session.get('_prestagere').ecompte }}<br/> <p>{{'Solde de votre compte'|trans}} : {{ app.session.get('_prestagere').ecompte }}<br/>
{% if KOH_RECONVERSION_PRESTATAIRE != '0' and KOH_RECONVERSION_PRESTATAIRE is not empty %} {% if KOH_RECONVERSION_PRESTATAIRE is defined and KOH_RECONVERSION_PRESTATAIRE != '0' and KOH_RECONVERSION_PRESTATAIRE is not empty %}
<em>{{'Taux de reconversion'|trans}} : {{app.session.get('_prestagere').tauxreconversion ? app.session.get('_prestagere').tauxreconversion : KOH_RECONVERSION_PRESTATAIRE}}%</em> <em>{{'Taux de reconversion'|trans}} : {{app.session.get('_prestagere').tauxreconversion ? app.session.get('_prestagere').tauxreconversion : KOH_RECONVERSION_PRESTATAIRE}}%</em>
{% endif %} {% endif %}
</p> </p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment