Project 'cooperatic/kohinos-tav' was moved to 'agplv3/kohinos-tav'. Please update any links and bookmarks that may still have the old path.
Commit 368bf173 by Damien Moulard

Merge branch '3576-inscription-modification-habitant' into 'develop'

3576 inscription modification habitant

See merge request cooperatic/kohinos-tav!23
parents c89e8ff7 6380045e
......@@ -62,4 +62,7 @@ deploy.php
templates/themes/custom/
#VSCODE
.vscode/
\ No newline at end of file
.vscode/
#INTELLIJ
.idea/
......@@ -92,4 +92,36 @@ $(document).ready(function() {
}
}
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
var moyenDePaiement = document.querySelector('[id$="_moyenDePaiement"].select2-container a span');
if(moyenDePaiement) {
var moyenDePaiementObserver = new MutationObserver(actionOnMoyenDePaiementChange);
moyenDePaiementObserver.observe(moyenDePaiement, {
childList: true
});
function actionOnMoyenDePaiementChange() {
var selector = document.querySelector('[id$="_jourPrelevement"].form-group');
if (selector !== null) {
selector.style.display = moyenDePaiement.innerHTML === "prélèvement" ? "" : "none";
}
}
actionOnMoyenDePaiementChange();
}
var recevoirUnRappel = document.querySelector('[id$="_mailRappelCotisation"].form-group div div label div');
if(recevoirUnRappel) {
var recevoirUnRappelObserver = new MutationObserver(actionOnRecevoirUnRappelChange);
recevoirUnRappelObserver.observe(recevoirUnRappel, {
attributes: true
});
function actionOnRecevoirUnRappelChange() {
var selector = document.querySelector('[id$="_jourMailRappelCotisation"].form-group');
if (selector !== null) {
selector.style.display = recevoirUnRappel.classList.contains('checked') ? "" : "none";
}
}
actionOnRecevoirUnRappelChange();
}
});
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.b35f5723.js"
"/build/admin.cee4d78d.js"
],
"css": [
"/build/admin.5dc0eea7.css"
......
......@@ -2,7 +2,7 @@
"build/app.css": "/build/app.8f9aaf53.css",
"build/app.js": "/build/app.fe8f482e.js",
"build/admin.css": "/build/admin.5dc0eea7.css",
"build/admin.js": "/build/admin.b35f5723.js",
"build/admin.js": "/build/admin.cee4d78d.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",
......
......@@ -33,6 +33,7 @@ use Sonata\DoctrineORMAdminBundle\Filter\CallbackFilter;
use Sonata\Form\Type\DateTimeRangePickerType;
use Sonata\UserBundle\Model\UserManagerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormError;
......@@ -171,6 +172,7 @@ class AdherentAdmin extends AbstractAdmin
;
if ($this->getConfigurationPool()->getContainer()->getParameter('tav_env')) {
$formMapper
->tab('General')
->with('Informations de cotisation', ['class' => 'col-md-5'])
......@@ -188,6 +190,36 @@ class AdherentAdmin extends AbstractAdmin
return $choice->__toString();
}
])
->add('moyenDePaiement', ChoiceType::class, [
'required' => true,
'label' => 'Moyen de paiement :',
'choices' => [
"CB" => "CB",
"espèces" => "espèces",
"chèque" => "chèque",
"prélèvement" => "prélèvement"
],
'empty_data' => null,
'placeholder' => 'Choisir un moyen de paiement'
])
->add('jourPrelevement', ChoiceType::class, [
'required' => false,
'label' => 'Jour de prélèvement :',
'choices' => $this->daysOfMonth(),
'empty_data' => null,
'placeholder' => 'Choisir un jour de prélèvement'
])
->add('mailRappelCotisation', CheckboxType::class, [
'required' => false,
'label' => 'Recevoir un rappel du paiement de ma cotisation par mail',
])
->add('jourMailRappelCotisation', ChoiceType::class, [
'required' => false,
'label' => 'Jour de l\'envoi du mail de rappel :',
'choices' => $this->daysOfMonth(),
'empty_data' => null,
'placeholder' => 'Choisir un jour pour l\'envoi du mail de rappel'
])
->end()
->end();
......@@ -542,5 +574,14 @@ class AdherentAdmin extends AbstractAdmin
return $iterator;
}
private function daysOfMonth()
{
$res = [];
for($i = 1 ; $i < 29 ; $i++) {
$res[$i] = $i;
}
return $res;
}
}
......@@ -93,6 +93,26 @@ class Adherent extends AccountableObject implements AccountableInterface
*/
private $profilDeCotisation;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $moyenDePaiement;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $jourPrelevement;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $mailRappelCotisation;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $jourMailRappelCotisation;
public function __construct()
{
$this->accounts = new ArrayCollection();
......@@ -267,4 +287,52 @@ class Adherent extends AccountableObject implements AccountableInterface
return $this;
}
public function getMoyenDePaiement(): ?string
{
return $this->moyenDePaiement;
}
public function setMoyenDePaiement(?string $moyenDePaiement): self
{
$this->moyenDePaiement = $moyenDePaiement;
return $this;
}
public function getJourPrelevement(): ?int
{
return $this->jourPrelevement;
}
public function setJourPrelevement(?int $jourPrelevement): self
{
$this->jourPrelevement = $jourPrelevement;
return $this;
}
public function getMailRappelCotisation(): ?bool
{
return $this->mailRappelCotisation;
}
public function setMailRappelCotisation(?bool $mailRappelCotisation): self
{
$this->mailRappelCotisation = $mailRappelCotisation;
return $this;
}
public function getJourMailRappelCotisation(): ?int
{
return $this->jourMailRappelCotisation;
}
public function setJourMailRappelCotisation(?int $jourMailRappelCotisation): self
{
$this->jourMailRappelCotisation = $jourMailRappelCotisation;
return $this;
}
}
<?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 Version20221220094507 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('ALTER TABLE adherent ADD moyen_de_paiement VARCHAR(255) DEFAULT NULL, ADD date_prelevement DATE DEFAULT NULL, ADD mail_rappel_cotisation TINYINT(1) DEFAULT NULL, ADD date_mail_rappel_cotisation DATE DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE adherent DROP moyen_de_paiement, DROP date_prelevement, DROP mail_rappel_cotisation, DROP date_mail_rappel_cotisation');
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\'');
}
}
<?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 Version20221220095617 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('ALTER TABLE adherent ADD jour_prelevement INT DEFAULT NULL, ADD jour_mail_rappel_cotisation INT DEFAULT NULL, DROP date_prelevement, DROP date_mail_rappel_cotisation');
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE adherent ADD date_prelevement DATE DEFAULT NULL, ADD date_mail_rappel_cotisation DATE DEFAULT NULL, DROP jour_prelevement, DROP jour_mail_rappel_cotisation');
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\'');
}
}
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