Commit 945bb9f3 by Damien Moulard

fix merge conflict + change comment

parents 8ded3409 e2c90d3a
......@@ -71,8 +71,9 @@ $(document).ready(function() {
});
});
// Hide or display Cotisation, Profils de Cotisation and Products Families submenu depending on TAV env
// Hide or display Cotisation, Profils de Cotisation and Products Families submenu depending on TAV env and/or household mode
const tav_env = document.getElementsByName('is-tav-env')[0].getAttribute('content');
const household_based_allowance = document.getElementsByName('is-household-based-allowance')[0].getAttribute('content');
let linksToCotisationAdherent = $('a[href="/admin/cotisation_adherent/list"]');
for(let i = 0 ; i < linksToCotisationAdherent.length ; i++) {
......@@ -89,7 +90,7 @@ $(document).ready(function() {
let linksToProfilDeCotisation = $('a[href="/admin/profilcotisation/list"]');
for(let i = 0 ; i < linksToProfilDeCotisation.length ; i++) {
if(linksToProfilDeCotisation[i].innerText === "Profils De Cotisation") {
linksToProfilDeCotisation[i].parentNode.style.display = (tav_env === "1") ? "" : "none";
linksToProfilDeCotisation[i].parentNode.style.display = (tav_env === "1" && household_based_allowance === "0") ? "" : "none";
}
}
let linksToProductsFamily = $('a[href="/admin/app/productfamily/list"]');
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,7 +12,7 @@
"admin": {
"js": [
"/build/runtime.6ad5c9da.js",
"/build/admin.a08fea06.js"
"/build/admin.3f7739a8.js"
],
"css": [
"/build/admin.4de55830.css"
......
......@@ -2,7 +2,7 @@
"build/app.css": "/build/app.ec67f059.css",
"build/app.js": "/build/app.3644f7b2.js",
"build/admin.css": "/build/admin.4de55830.css",
"build/admin.js": "/build/admin.a08fea06.js",
"build/admin.js": "/build/admin.3f7739a8.js",
"build/runtime.js": "/build/runtime.6ad5c9da.js",
"build/images/fa-solid-900.svg": "/build/images/fa-solid-900.a838c42a.svg",
"build/images/fa-brands-400.svg": "/build/images/fa-brands-400.05d20183.svg",
......
......@@ -173,8 +173,8 @@ class AdherentAdmin extends AbstractAdmin
}
$withQuartier = $em->getRepository(GlobalParameter::class)->val(GlobalParameter::SSA_HOUSEHOLD_WITH_QUARTIER);
$withSubterritory = $em->getRepository(GlobalParameter::class)->val(GlobalParameter::SSA_HOUSEHOLD_WITH_SUBTERRITORY);
$withQuartier = $em->getRepository(GlobalParameter::class)->val(GlobalParameter::GEOLOC_WITH_QUARTIER);
$withSubterritory = $em->getRepository(GlobalParameter::class)->val(GlobalParameter::GEOLOC_WITH_SUBTERRITORY);
$formMapper
->tab('General')
......@@ -189,8 +189,8 @@ class AdherentAdmin extends AbstractAdmin
'required' => true,
'with_geoloc' => false,
'with_latlon' => false,
'with_subterritory' => $tav_env && 'true' === $withSubterritory,
'with_quartier' => $tav_env && 'true' === $withQuartier
'with_subterritory' => 'true' === $withSubterritory,
'with_quartier' => 'true' === $withQuartier
])
->end()
->with('Groupe', ['class' => 'col-md-5'])
......@@ -752,16 +752,18 @@ class AdherentAdmin extends AbstractAdmin
])
;
$withSubterritory = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(GlobalParameter::class)->val(GlobalParameter::GEOLOC_WITH_SUBTERRITORY);
if('true' === $withSubterritory) {
$datagridMapper->add('geoloc.subterritory', null, [
'label' => 'Territoire',
'advanced_filter' => false,
'show_filter' => true,
]);
}
if ($this->getConfigurationPool()->getContainer()->getParameter('tav_env')) {
$datagridMapper
->remove('cotisationajour');
if($this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance')) {
$datagridMapper->add('geoloc.subterritory', null, [
'label' => 'Territoire',
'advanced_filter' => false,
'show_filter' => true,
]);
}
if ($this->getConfigurationPool()->getContainer()->getParameter('ccas_mode')) {
$datagridMapper
->add('anonymoustoken', CallbackFilter::class, [
......
......@@ -4,6 +4,7 @@ namespace App\Admin;
use App\Entity\Flux;
use App\Entity\Subterritory;
use App\Entity\GlobalParameter;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
......@@ -177,11 +178,10 @@ class FluxAdmin extends AbstractAdmin
])
;
// In household based allowance (but not simplified) add filter on adherent territory
$household_based_allowance = $this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance');
$simplified_household_based_allowance = $this->getConfigurationPool()->getContainer()->getParameter('simplified_household_based_allowance');
// Add filter on adherent territory if active
$withSubterritory = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(GlobalParameter::class)->val(GlobalParameter::GEOLOC_WITH_SUBTERRITORY);
if($household_based_allowance && !$simplified_household_based_allowance) {
if('true' === $withSubterritory) {
$datagridMapper->add('territory', CallbackFilter::class, [
'callback' => [$this, 'getTerritoryFilter'],
'field_type' => SChoiceType::class,
......
......@@ -71,11 +71,10 @@ class OperationAdherentAdmin extends OperationAdmin
'show_filter' => true,
]);
// In household based allowance (but not simplified) add filter on adherent territory
$household_based_allowance = $this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance');
$simplified_household_based_allowance = $this->getConfigurationPool()->getContainer()->getParameter('simplified_household_based_allowance');
// Add filter on adherent territory if active
$withSubterritory = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(GlobalParameter::class)->val(GlobalParameter::GEOLOC_WITH_SUBTERRITORY);
if($household_based_allowance && !$simplified_household_based_allowance) {
if('true' === $withSubterritory) {
$datagridMapper->add('account.adherent.geoloc.subterritory', null, [
'label' => 'Territoire',
'advanced_filter' => false,
......
......@@ -73,6 +73,9 @@ class GlobalParameter
const SSA_HOUSEHOLD_QUARTIER_LIST_VALUES = 'SSA_HOUSEHOLD_QUARTIER_LIST_VALUES';
const SSA_HOUSEHOLD_WITH_SUBTERRITORY = 'SSA_HOUSEHOLD_WITH_SUBTERRITORY';
const SSA_HOUSEHOLD_COTIS_MINIMUM_BY_SHARE = 'SSA_HOUSEHOLD_COTIS_MINIMUM_BY_SHARE';
const GEOLOC_WITH_QUARTIER = 'GEOLOC_WITH_QUARTIER';
const GEOLOC_QUARTIER_LIST_VALUES = 'GEOLOC_QUARTIER_LIST_VALUES';
const GEOLOC_WITH_SUBTERRITORY = 'GEOLOC_WITH_SUBTERRITORY';
/**
* @var \Ramsey\Uuid\UuidInterface
......
......@@ -79,7 +79,7 @@ class GeolocFormType extends AbstractType
;
}
if (true === $options['with_quartier']) {
$quartierListValues = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::SSA_HOUSEHOLD_QUARTIER_LIST_VALUES);
$quartierListValues = $this->em->getRepository(GlobalParameter::class)->val(GlobalParameter::GEOLOC_QUARTIER_LIST_VALUES);
if (null !== $quartierListValues && '' !== $quartierListValues) {
$quartierListValuesArr = explode(",", $quartierListValues);
......
......@@ -24,8 +24,8 @@ final class Version20250415103920 extends AbstractMigration
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_WITH_QUARTIER', 'En mode SSA, si la valeur est à true, affiche le champ \'Quartier\' dans la fiche Adhérent.', 'true', '0')");
$this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_QUARTIER_LIST_VALUES', 'En mode SSA, si le champ \'Quartier\' est affiché et que ce paramètre est renseigné, affiche le champ sous forme de liste déroulante plutôt que de champ libre. Renseigner les valeurs séparées par une virgule sans espace (ex: Facultés,Hôpitaux,Montpellier Ouest,Gambetta).', '', '0')");
$this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_WITH_QUARTIER', 'Si la valeur est à true, affiche le champ \'Quartier\' dans la fiche Adhérent.', 'true', '0')");
$this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_QUARTIER_LIST_VALUES', 'Si le champ \'Quartier\' est affiché et que ce paramètre est renseigné, affiche le champ sous forme de liste déroulante plutôt que de champ libre. Renseigner les valeurs séparées par une virgule sans espace (ex: Facultés,Hôpitaux,Montpellier Ouest,Gambetta).', '', '0')");
$containerName = trim(file_get_contents('/etc/hostname'));
......@@ -41,7 +41,7 @@ INSERT INTO global_parameter (id, name, description, value, mandatory)
VALUES (
UUID(),
'SSA_HOUSEHOLD_WITH_SUBTERRITORY',
'En mode SSA, si la valeur est à true, affiche le champ \'Territoire\' dans la fiche Adhérent.',
'Si la valeur est à true, affiche le champ \'Territoire\' dans la fiche Adhérent.',
'$withSubterritoryDefaultValue',
'0'
)
......
......@@ -20,7 +20,7 @@ final class Version20250417105302 extends AbstractMigration
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_COTIS_MINIMUM_BY_SHARE', 'Si la valeur est à true, SSA_HOUSEHOLD_COTISATION_MINIMUM s''entend alors par part et non par foyer. Le nombre de parts est le rapport arrondi à l''unité inférieure entre le montant d''allocation et SSA_HOUSEHOLD_BASE_AMOUNT. Le montant d''allocation utilisé dans le calcul du nombre de part ne tient pas compte de SSA_FORCE_ALLOCATION_AMOUNT ou SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT.', null, '0')");
$this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_COTIS_MINIMUM_BY_SHARE', 'Si la valeur est à true et que SSA_HOUSEHOLD_COTISATION_MINIMUM est défini, active un minimum de cotisation par part plutôt que par foyer. La part correspond à la valeur de SSA_HOUSEHOLD_BASE_AMOUNT, et on recherche le nombre de parts dans le montant d\'allocation prévu (avant application éventuelle de SSA_FORCE_ALLOCATION_AMOUNT ou SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT). Le minimum est alors SSA_HOUSEHOLD_COTISATION_MINIMUM * nb de parts.', null, '0')");
}
public function down(Schema $schema) : void
......
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250418111930 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql("UPDATE global_parameter SET name = 'GEOLOC_WITH_QUARTIER' WHERE name = 'SSA_HOUSEHOLD_WITH_QUARTIER'");
$this->addSql("UPDATE global_parameter SET name = 'GEOLOC_QUARTIER_LIST_VALUES' WHERE name = 'SSA_HOUSEHOLD_QUARTIER_LIST_VALUES'");
$this->addSql("UPDATE global_parameter SET name = 'GEOLOC_WITH_SUBTERRITORY' WHERE name = 'SSA_HOUSEHOLD_WITH_SUBTERRITORY'");
}
public function down(Schema $schema) : void
{
$this->addSql("UPDATE global_parameter SET name = 'SSA_HOUSEHOLD_WITH_QUARTIER' WHERE name = 'GEOLOC_WITH_QUARTIER'");
$this->addSql("UPDATE global_parameter SET name = 'SSA_HOUSEHOLD_QUARTIER_LIST_VALUES' WHERE name = 'GEOLOC_QUARTIER_LIST_VALUES'");
$this->addSql("UPDATE global_parameter SET name = 'SSA_HOUSEHOLD_WITH_SUBTERRITORY' WHERE name = 'GEOLOC_WITH_SUBTERRITORY'");
// this down() migration is auto-generated, please modify it to your needs
}
}
......@@ -27,6 +27,7 @@ Modified for MLC from Sonata package.
<head>
<title>{{title|default('Kohinos') }}</title>
<meta name="is-tav-env" content="{{ tav_env }}" />
<meta name="is-household-based-allowance" content="{{ household_based_allowance }}" />
<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') }}" />
......
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