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",
"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": {
"php": "^7.1.3",
"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
......@@ -8,7 +8,7 @@ use Symfony\Component\Routing\Annotation\Route;
class ComptoirController extends FrontController
{
private $em;
protected $em;
public function __construct(EntityManagerInterface $em)
{
......
<?php
namespace App\DQL
;
namespace App\DQL;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
......
......@@ -10,5 +10,4 @@ namespace App\Exception;
*/
class BadRequestDataException extends \Exception
{
}
......@@ -49,7 +49,7 @@ class CotisationInfosFormType extends FluxFormType
'html5' => false,
'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
->add('recu', CheckboxType::class, array('label' => 'Reçu'));
}
......
......@@ -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 !'])
],
))
// @TODO : checkbox au lieu de texttype pour certains paramètres globaux
->add('usewordpress', GlobalParameterType::class, array(
'label' => "Utiliser Wordpress pour le site web :",
'name_param' => GlobalParameter::USE_WORDPRESS,
......
......@@ -62,7 +62,6 @@ class VoterSecurityHandler extends RoleSecurityHandler
private function isAnyGranted(array $attributes, $subject = null): bool
{
// $user = $this->tokenStorageInterface->getToken()->getUser();
foreach ($attributes as $attribute) {
if ($this->authorizationChecker->isGranted($attribute, $subject)) {
return true;
......
......@@ -18,6 +18,16 @@ class MlcGlobalsExtension extends AbstractExtension implements GlobalsInterface
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 @@
{% endif %}
{{ form_row(form.geoloc) }}
<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) }}
</div>
{{form_end(form)}}
......
......@@ -24,8 +24,8 @@
<h3 class="box-title">{{ 'GLOBAL'|trans }}</h3>
</div>
<div class="box-body">
<h4>Solde de MLC en circulation : 12345 {{KOH_MLC_NAME_SMALL}}</h4>
<h4>Solde de Monnaie Nantie : 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|default('') }}</h4>
</div>
</div>
......
<header class="container header">
<nav class="menu navbar navbar-expand-md navbar-light bg-light">
<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>
{% block menu %}
......
......@@ -11,6 +11,8 @@
<title>{{title|default('Kohinos') }}</title>
<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="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
{# FAVICON #}
{% block favicon %}
......@@ -72,6 +74,18 @@
$('#roleGroupeModal').modal('show');
});
</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>
......
......@@ -16,6 +16,9 @@
</div>
</li>
{% 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 %}
{% import 'common/menu_tree_macro.html.twig' as tree %}
{% set currentPath = app.request.requestUri %}
......
......@@ -14,13 +14,13 @@
</p>
{# @TODO (pas prioritaire) : Statistiques avancées :
<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>
<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>
<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>
<i class="fa fa-check"> </i> 192923 d'échanges numériques
......
......@@ -6,10 +6,10 @@
<div class='text-center mb-5'>
{% if isCurrentRoleGranted('ROLE_ADHERENT') %}
<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') %}
<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 %}
</h5>
{{ form_start(form) }}
......
......@@ -5,6 +5,15 @@
<div class='row mt-3'>
<div class='col-12 text-center'>
{% 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' %}
{% endblock colonne_centre %}
</div>
......
......@@ -2,6 +2,9 @@
{% form_theme form _self %}
{% block menu %}
{% endblock menu %}
{% block content %}
<div class='container homepage'>
<div class="card mx-auto mt-5" style="max-width: 600px;">
......
......@@ -5,7 +5,7 @@
{% endblock blocktitle %}
{% block blockcontent %}
<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>
{% endif %}
</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