From bf5af1a4b52b463fed0c175fe6884542f511938a Mon Sep 17 00:00:00 2001 From: NACorp Date: Thu, 5 Dec 2024 17:03:18 +0100 Subject: [PATCH 1/4] suppression colonne twitter et map responsive --- app/Resources/views/site/offices.html.twig | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/Resources/views/site/offices.html.twig b/app/Resources/views/site/offices.html.twig index 2ba72da51..c059d09de 100644 --- a/app/Resources/views/site/offices.html.twig +++ b/app/Resources/views/site/offices.html.twig @@ -18,6 +18,10 @@ text-decoration: none; } + .map-container img { + max-width: 100%; + } + .city-link { line-height: 1.909em; font-size: 1.46em; @@ -295,16 +299,8 @@

Une quinzaine d'antennes locales, représentantes de l'AFUP en région, organise rencontres, meetups et apéros PHP tout au long de l'année, tisse des liens au sein de la communauté de développeuses et de développeurs et fait la promotion du PHP dans les entreprises partout en France.

-
-
-
-
Carte de France des antennes de l'AFUP.
-
-
- +
+
Carte de France des antennes de l'AFUP.

Concrètement que se passe-t-il près de chez moi ?

From 0d08d6147fe40e115f16be5e4bf70612a569485e Mon Sep 17 00:00:00 2001 From: Albin Kester <83301974+stakovicz@users.noreply.github.com> Date: Fri, 6 Dec 2024 07:36:47 +0100 Subject: [PATCH 2/4] afup#1564 mariadb to mysql (#1565) * issue#1564 change database image * issue#1564 fix fixtures * issue#1564 fix tests * issue#1564 sql schema * issue#1564 lint compose.yml --- compose.yml | 10 ++++----- db/migrations/20180526091813_init.sql | 10 ++++----- .../20241202162110_mariadb_to_mysql.php | 22 +++++++++++++++++++ db/seeds/Compta.php | 4 ++-- db/seeds/Event.php | 4 ++-- docker/dockerfiles/mysql/Dockerfile | 2 +- docker/dockerfiles/mysql/my.cnf | 1 + docker/dockerfiles/mysqltest/Dockerfile | 2 +- docker/dockerfiles/mysqltest/my.cnf | 1 + htdocs/pages/administration/compta_devis.php | 14 ++++++------ .../pages/administration/compta_facture.php | 6 ++--- .../administration/forum_inscriptions.php | 4 ++-- .../pages/administration/forum_sessions.php | 16 +++++++------- sources/Afup/Comptabilite/Facture.php | 4 ++-- sources/Afup/Corporate/Feuille.php | 4 ++-- sources/Afup/Forum/AppelConferencier.php | 19 +++++++++------- sources/Afup/Forum/Inscriptions.php | 2 +- sources/Afup/Utils/Base_De_Donnees.php | 4 ++++ .../Repository/CompanyMemberRepository.php | 4 +++- .../Model/Repository/EventRepository.php | 16 +++++++++----- .../Model/Repository/InvoiceRepository.php | 2 ++ .../Model/Repository/SpeakerRepository.php | 7 ++++-- .../Event/Model/Repository/TalkRepository.php | 6 +++-- .../Repository/TicketEventTypeRepository.php | 4 ++-- sources/AppBundle/Event/Model/Talk.php | 4 ++-- sources/AppBundle/Event/Model/Ticket.php | 6 ++--- 26 files changed, 111 insertions(+), 67 deletions(-) create mode 100644 db/migrations/20241202162110_mariadb_to_mysql.php diff --git a/compose.yml b/compose.yml index 342fddeb9..5c2e7b79b 100644 --- a/compose.yml +++ b/compose.yml @@ -1,5 +1,3 @@ -version: "2.2" - services: db: build: ./docker/dockerfiles/mysql @@ -21,7 +19,7 @@ services: volumes: - ./data/mysqltest:/var/lib/mysql healthcheck: - test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] + test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ] timeout: 20s retries: 10 @@ -58,7 +56,7 @@ services: links: - statictestresources healthcheck: - test: ["CMD", "curl", "-f", "https://apachephptest:80"] + test: [ "CMD", "curl", "-f", "https://apachephptest:80" ] interval: 30s timeout: 10s retries: 5 @@ -76,8 +74,8 @@ services: .env user: localUser volumes: - - ./data/composer:/home/localUser/.composer - - ./:/var/www/html + - ./data/composer:/home/localUser/.composer + - ./:/var/www/html links: - db - apachephp diff --git a/db/migrations/20180526091813_init.sql b/db/migrations/20180526091813_init.sql index f0eaec830..45b5d38e5 100644 --- a/db/migrations/20180526091813_init.sql +++ b/db/migrations/20180526091813_init.sql @@ -394,8 +394,8 @@ CREATE TABLE `afup_forum` ( `trello_list_id` varchar(100) CHARACTER SET utf8 DEFAULT NULL, `logo_url` varchar(100) CHARACTER SET utf8 DEFAULT NULL, `nb_places` int(11) unsigned NOT NULL DEFAULT '0', - `date_debut` date NOT NULL DEFAULT '0000-00-00', - `date_fin` date NOT NULL DEFAULT '0000-00-00', + `date_debut` date NULL, + `date_fin` date NULL, `annee` int(11) DEFAULT NULL, `text` text, `date_fin_appel_projet` int(11) DEFAULT NULL, @@ -935,7 +935,7 @@ DROP TABLE IF EXISTS `afup_sessions`; CREATE TABLE `afup_sessions` ( `session_id` int(11) NOT NULL AUTO_INCREMENT, `id_forum` smallint(6) NOT NULL DEFAULT '0', - `date_soumission` date NOT NULL DEFAULT '0000-00-00', + `date_soumission` date NOT NULL, `titre` varchar(255) NOT NULL DEFAULT '', `abstract` text NOT NULL, `staff_notes` text, @@ -985,7 +985,7 @@ CREATE TABLE `afup_sessions_note` ( `session_id` int(11) NOT NULL DEFAULT '0', `note` tinyint(4) NOT NULL DEFAULT '0', `salt` char(32) NOT NULL DEFAULT '', - `date_soumission` date NOT NULL DEFAULT '0000-00-00', + `date_soumission` date NOT NULL, PRIMARY KEY (`note`,`session_id`,`salt`) USING BTREE ) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1441,7 +1441,7 @@ CREATE TABLE `compta` ( `attachment_filename` varchar(255) DEFAULT NULL, `numero` varchar(50) NOT NULL, `idmode_regl` tinyint(5) NOT NULL, - `date_regl` date NOT NULL, + `date_regl` date NULL, `obs_regl` varchar(255) NOT NULL, `idevenement` tinyint(5) NOT NULL, `idcompte` tinyint(2) NOT NULL DEFAULT '1', diff --git a/db/migrations/20241202162110_mariadb_to_mysql.php b/db/migrations/20241202162110_mariadb_to_mysql.php new file mode 100644 index 000000000..d3c94060e --- /dev/null +++ b/db/migrations/20241202162110_mariadb_to_mysql.php @@ -0,0 +1,22 @@ +execute("ALTER TABLE afup_sessions ALTER COLUMN skill SET DEFAULT 0"); + $this->execute("ALTER TABLE afup_forum MODIFY date_debut date NULL"); + $this->execute("ALTER TABLE afup_forum MODIFY date_fin date NULL"); + $this->execute("ALTER TABLE afup_sessions ALTER COLUMN has_allowed_to_sharing_with_local_offices SET DEFAULT 0"); + $this->execute("ALTER TABLE compta MODIFY idevenement TINYINT(5) NULL"); + $this->execute("ALTER TABLE compta MODIFY date_regl date NULL"); + $this->execute("ALTER TABLE compta_categorie MODIFY idevenement TINYINT(5) NULL"); + $this->execute("ALTER TABLE afup_compta_facture MODIFY date_facture DATE NULL"); + $this->execute("ALTER TABLE afup_compta_facture MODIFY numero_facture VARCHAR(50) NULL"); + $this->execute("ALTER TABLE compta MODIFY idclef VARCHAR(20) NULL"); + $this->execute("ALTER TABLE afup_inscription_forum MODIFY transport_mode SMALLINT NULL"); + } +} + diff --git a/db/seeds/Compta.php b/db/seeds/Compta.php index 9a7c9ec5a..4f7a8cebb 100644 --- a/db/seeds/Compta.php +++ b/db/seeds/Compta.php @@ -69,7 +69,7 @@ public function run() 'idoperation' => 0, 'idcategorie' => 0, 'idmode_regl' => 0, - 'date_regl' => '0000-00-00', + 'date_regl' => null, 'idevenement' => 0, ], [ @@ -89,7 +89,7 @@ public function run() 'idoperation' => 0, 'idcategorie' => 0, 'idmode_regl' => 0, - 'date_regl' => '0000-00-00', + 'date_regl' => null, 'idevenement' => 0, ], ]; diff --git a/db/seeds/Event.php b/db/seeds/Event.php index 2146ce292..f67a1739a 100644 --- a/db/seeds/Event.php +++ b/db/seeds/Event.php @@ -40,7 +40,7 @@ public function run() 'date_fin_saisie_nuites_hotel' => $event - $oneDayInSeconds * 7, 'place_name' => 'Paris', 'place_address' => 'Marriott Rive Gauche', - 'date_annonce_planning' => date('Y-m-d H:i:s', $now - $oneMonthInSeconds), + 'date_annonce_planning' => $now - $oneMonthInSeconds, 'transport_information_enabled' => 1, 'has_prices_defined_with_vat' => 1, ], @@ -70,7 +70,7 @@ public function run() 'date_fin_saisie_nuites_hotel' => $event - $oneDayInSeconds * 7, 'place_name' => 'Paris', 'place_address' => 'Marriott Rive Gauche', - 'date_annonce_planning' => date('Y-m-d H:i:s', $now - $oneMonthInSeconds), + 'date_annonce_planning' => $now - $oneMonthInSeconds, 'transport_information_enabled' => 1, 'has_prices_defined_with_vat' => 1, ], diff --git a/docker/dockerfiles/mysql/Dockerfile b/docker/dockerfiles/mysql/Dockerfile index 386be002c..bb1325601 100644 --- a/docker/dockerfiles/mysql/Dockerfile +++ b/docker/dockerfiles/mysql/Dockerfile @@ -1,4 +1,4 @@ -FROM mariadb:10.0.29 +FROM mysql:5.7 COPY my.cnf /etc/mysql/my.cnf COPY mysql /opt/mysql diff --git a/docker/dockerfiles/mysql/my.cnf b/docker/dockerfiles/mysql/my.cnf index 74833b96a..f12448d2d 100644 --- a/docker/dockerfiles/mysql/my.cnf +++ b/docker/dockerfiles/mysql/my.cnf @@ -2,3 +2,4 @@ skip-host-cache skip-name-resolve innodb_file_per_table=1 +sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION" diff --git a/docker/dockerfiles/mysqltest/Dockerfile b/docker/dockerfiles/mysqltest/Dockerfile index 12ab8ca35..45ba3b8d9 100644 --- a/docker/dockerfiles/mysqltest/Dockerfile +++ b/docker/dockerfiles/mysqltest/Dockerfile @@ -1,4 +1,4 @@ -FROM mariadb:10.0.29 +FROM mysql:5.7 COPY my.cnf /etc/mysql/my.cnf COPY mysql /opt/mysql diff --git a/docker/dockerfiles/mysqltest/my.cnf b/docker/dockerfiles/mysqltest/my.cnf index 74833b96a..f12448d2d 100644 --- a/docker/dockerfiles/mysqltest/my.cnf +++ b/docker/dockerfiles/mysqltest/my.cnf @@ -2,3 +2,4 @@ skip-host-cache skip-name-resolve innodb_file_per_table=1 +sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION" diff --git a/htdocs/pages/administration/compta_devis.php b/htdocs/pages/administration/compta_devis.php index cf5c7ec0a..b4da2d37b 100644 --- a/htdocs/pages/administration/compta_devis.php +++ b/htdocs/pages/administration/compta_devis.php @@ -239,9 +239,9 @@ function prepareDefaultsFromComptaFacId(Facture $comptaFact, $id) { $ok = $comptaFact->ajouter_details( $valeur['ref'.$i], $valeur['designation'.$i], - $valeur['quantite'.$i], - $valeur['pu'.$i], - $valeur['tva'.$i] + (int)$valeur['quantite'.$i], + (float)$valeur['pu'.$i], + (int)$valeur['tva'.$i] ); } } else { @@ -264,7 +264,7 @@ function prepareDefaultsFromComptaFacId(Facture $comptaFact, $id) { $valeur['ref_clt2'], $valeur['ref_clt3'], $valeur['numero_devis'], - $valeur['numero_facture'], + $valeur['numero_facture'] ?? null, 0, null, $valeur['devise_facture'] @@ -275,9 +275,9 @@ function prepareDefaultsFromComptaFacId(Facture $comptaFact, $id) { $valeur['id'.$i], $valeur['ref'.$i], $valeur['designation'.$i], - $valeur['quantite'.$i], - $valeur['pu'.$i], - $valeur['tva'.$i] + (int)$valeur['quantite'.$i], + (float)$valeur['pu'.$i], + (int)$valeur['tva'.$i] ); } diff --git a/htdocs/pages/administration/compta_facture.php b/htdocs/pages/administration/compta_facture.php index 336891bfb..3a28f9ab6 100644 --- a/htdocs/pages/administration/compta_facture.php +++ b/htdocs/pages/administration/compta_facture.php @@ -247,9 +247,9 @@ $valeur['id'.$i], $valeur['ref'.$i], $valeur['designation'.$i], - $valeur['quantite'.$i], - $valeur['pu'.$i], - $valeur['tva'.$i] + (int)$valeur['quantite'.$i], + (float)$valeur['pu'.$i], + (int)$valeur['tva'.$i] ); } diff --git a/htdocs/pages/administration/forum_inscriptions.php b/htdocs/pages/administration/forum_inscriptions.php index de4eee3f7..7598b8d25 100644 --- a/htdocs/pages/administration/forum_inscriptions.php +++ b/htdocs/pages/administration/forum_inscriptions.php @@ -399,8 +399,8 @@ function updateGlobalsForTarif( $valeurs['commentaires'], $valeurs['etat'], $valeurs['facturation'], - $valeurs['transport_mode'], - $valeurs['transport_distance']); + (int)$valeurs['transport_mode'], + (int)$valeurs['transport_distance']); /** @var \AppBundle\Event\Model\Ticket $ticket */ $ticket = $ticketRepository->get($_GET['id']); diff --git a/htdocs/pages/administration/forum_sessions.php b/htdocs/pages/administration/forum_sessions.php index 4cfe5b018..0c3be72b8 100644 --- a/htdocs/pages/administration/forum_sessions.php +++ b/htdocs/pages/administration/forum_sessions.php @@ -241,10 +241,10 @@ $valeurs['date_soumission']['Y'].'-'.$valeurs['date_soumission']['M'].'-'.$valeurs['date_soumission']['d'], $valeurs['titre'], $valeurs['abstract'], - $valeurs['genre'], - $valeurs['plannifie'], - isset($valeurs['needs_mentoring']) ? $valeurs['needs_mentoring'] : 0, - $valeurs['skill'], + (int)$valeurs['genre'], + (int)$valeurs['plannifie'], + isset($valeurs['needs_mentoring']) ? (int)$valeurs['needs_mentoring'] : 0, + (int)$valeurs['skill'], $valeurs['use_markdown'] ); $ok = (bool)$session_id; @@ -255,8 +255,8 @@ $valeurs['date_soumission']['Y'].'-'.$valeurs['date_soumission']['M'].'-'.$valeurs['date_soumission']['d'], $valeurs['titre'], $valeurs['abstract'], - $valeurs['genre'], - $valeurs['plannifie'], + (int)$valeurs['genre'], + (int)$valeurs['plannifie'], $valeurs['joindin'], $valeurs['youtube_id'], $valeurs['slides_url'], @@ -264,8 +264,8 @@ $valeurs['blog_post_url'], $valeurs['interview_url'], $valeurs['language_code'], - $valeurs['skill'], - $valeurs['needs_mentoring'], + (int)$valeurs['skill'], + (int)$valeurs['needs_mentoring'], $valeurs['use_markdown'], $valeurs['video_has_fr_subtitles'], $valeurs['video_has_en_subtitles'], diff --git a/sources/Afup/Comptabilite/Facture.php b/sources/Afup/Comptabilite/Facture.php index 68d1b5aa6..f3497b8a1 100644 --- a/sources/Afup/Comptabilite/Facture.php +++ b/sources/Afup/Comptabilite/Facture.php @@ -180,7 +180,7 @@ function ajouter($date_devis, $societe, $service, $adresse, $code_postal, $ville return $this->_bdd->executer($requete); } - function ajouter_details($ref, $designation, $quantite, $pu, $tva = 0) + function ajouter_details($ref, $designation, int $quantite, float $pu, int $tva = 0) { $requete = 'INSERT INTO '; $requete .= 'afup_compta_facture_details ('; @@ -237,7 +237,7 @@ function modifier($id, $date_devis, $societe, $service, $adresse, $code_postal, return $this->_bdd->executer($requete); } - function modifier_details($id, $ref, $designation, $quantite, $pu, $tva = 0) + function modifier_details($id, $ref, $designation, int $quantite, float $pu, int $tva = 0) { $requete = 'UPDATE '; $requete .= 'afup_compta_facture_details '; diff --git a/sources/Afup/Corporate/Feuille.php b/sources/Afup/Corporate/Feuille.php index 6ea7fb0f5..7d3fda2b3 100644 --- a/sources/Afup/Corporate/Feuille.php +++ b/sources/Afup/Corporate/Feuille.php @@ -45,7 +45,7 @@ function inserer() } $requete = 'INSERT INTO afup_site_feuille SET - id_parent = ' . $this->bdd->echapper($this->id_parent) . ', + id_parent = ' . $this->bdd->echapper(!$this->id_parent ? null : $this->id_parent) . ', nom = ' . $this->bdd->echapper($this->nom) . ', lien = ' . $this->bdd->echapper($this->lien) . ', alt = ' . $this->bdd->echapper($this->alt) . ', @@ -66,7 +66,7 @@ function modifier() { $requete = 'UPDATE afup_site_feuille SET - id_parent = ' . $this->bdd->echapper($this->id_parent) . ', + id_parent = ' . $this->bdd->echapper(!$this->id_parent ? null : $this->id_parent) . ', nom = ' . $this->bdd->echapper($this->nom) . ', lien = ' . $this->bdd->echapper($this->lien) . ', alt = ' . $this->bdd->echapper($this->alt) . ', diff --git a/sources/Afup/Forum/AppelConferencier.php b/sources/Afup/Forum/AppelConferencier.php index 74ce6b207..f5c680c5b 100644 --- a/sources/Afup/Forum/AppelConferencier.php +++ b/sources/Afup/Forum/AppelConferencier.php @@ -404,8 +404,8 @@ public function modifierSession( $date_soumission, $titre, $abstract, - $genre, - $plannifie, + int $genre, + int $plannifie, $joindin = null, $youtubeId = null, $slidesUrl = null, @@ -413,8 +413,8 @@ public function modifierSession( $blogPostUrl = null, $interviewUrl = null, $languageCode = null, - $skill = null, - $needs_mentoring = null, + int $skill = null, + int $needs_mentoring = null, $use_markdown = null, $video_has_fr_subtitles = null, $video_has_en_subtitles = null, @@ -499,10 +499,10 @@ public function ajouterSession( $date_soumission, $titre, $abstract, - $genre, - $plannifie = 0, - $needs_mentoring = 0, - $level = Talk::SKILL_NA, + int $genre, + int $plannifie = 0, + int $needs_mentoring = 0, + int $level = Talk::SKILL_NA, $useMarkdown = false ) { @@ -541,6 +541,9 @@ function delierSession($session_id) public function lierConferencierSession($conferencier_id, $session_id) { + if (!$conferencier_id) { + return true; + } $donnees = array( $this->_bdd->echapper($conferencier_id), $this->_bdd->echapper($session_id), diff --git a/sources/Afup/Forum/Inscriptions.php b/sources/Afup/Forum/Inscriptions.php index e316f7e0f..2f1934566 100644 --- a/sources/Afup/Forum/Inscriptions.php +++ b/sources/Afup/Forum/Inscriptions.php @@ -263,7 +263,7 @@ function obtenirListe($id_forum = null, function modifierInscription($id, $reference, $type_inscription, $civilite, $nom, $prenom, $email, $telephone, $coupon, $citer_societe, $newsletter_afup, $newsletter_nexen, $mail_partenaire, $commentaires, $etat, $facturation, - $transportMode, $transportDistance) + int $transportMode, int $transportDistance) { $requete = 'UPDATE '; $requete .= ' afup_inscription_forum '; diff --git a/sources/Afup/Utils/Base_De_Donnees.php b/sources/Afup/Utils/Base_De_Donnees.php index f97bb1e89..b43e0199c 100644 --- a/sources/Afup/Utils/Base_De_Donnees.php +++ b/sources/Afup/Utils/Base_De_Donnees.php @@ -234,6 +234,10 @@ public function getLastErrorMessage() function executer($requete) { $result = mysqli_query($this->getDbLink(), $requete); + if (!$result) { + throw new \RuntimeException(mysqli_error($this->getDbLink())); + } + return $result; } diff --git a/sources/AppBundle/Association/Model/Repository/CompanyMemberRepository.php b/sources/AppBundle/Association/Model/Repository/CompanyMemberRepository.php index 21f4eeb72..8281b4b24 100644 --- a/sources/AppBundle/Association/Model/Repository/CompanyMemberRepository.php +++ b/sources/AppBundle/Association/Model/Repository/CompanyMemberRepository.php @@ -4,6 +4,7 @@ use AppBundle\Association\Model\CompanyMember; use Aura\SqlQuery\Common\SelectInterface; +use CCMBenchmark\Ting\Driver\Mysqli\Serializer\Boolean; use CCMBenchmark\Ting\Repository\HydratorSingleObject; use CCMBenchmark\Ting\Repository\Metadata; use CCMBenchmark\Ting\Repository\MetadataInitializer; @@ -170,7 +171,8 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor ->addField([ 'columnName' => 'public_profile_enabled', 'fieldName' => 'publicProfileEnabled', - 'type' => 'boolean', + 'type' => 'bool', + 'serializer' => Boolean::class ]) ->addField([ 'columnName' => 'description', diff --git a/sources/AppBundle/Event/Model/Repository/EventRepository.php b/sources/AppBundle/Event/Model/Repository/EventRepository.php index 1a0f32fed..b624a8a67 100644 --- a/sources/AppBundle/Event/Model/Repository/EventRepository.php +++ b/sources/AppBundle/Event/Model/Repository/EventRepository.php @@ -5,6 +5,7 @@ use AppBundle\Event\Model\Event; use AppBundle\Event\Model\GithubUser; use AppBundle\Event\Model\Ticket; +use CCMBenchmark\Ting\Driver\Mysqli\Serializer\Boolean; use CCMBenchmark\Ting\Repository\CollectionInterface; use CCMBenchmark\Ting\Repository\HydratorArray; use CCMBenchmark\Ting\Repository\HydratorSingleObject; @@ -326,22 +327,26 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor ->addField([ 'columnName' => 'vote_enabled', 'fieldName' => 'voteEnabled', - 'type' => 'boolean' + 'type' => 'bool', + 'serializer' => Boolean::class ]) ->addField([ 'columnName' => 'has_prices_defined_with_vat', 'fieldName' => 'hasPricesDefinedWithVat', - 'type' => 'boolean' + 'type' => 'bool', + 'serializer' => Boolean::class ]) ->addField([ 'columnName' => 'speakers_diner_enabled', 'fieldName' => 'speakersDinerEnabled', - 'type' => 'boolean' + 'type' => 'bool', + 'serializer' => Boolean::class ]) ->addField([ 'columnName' => 'accomodation_enabled', 'fieldName' => 'accomodationEnabled', - 'type' => 'boolean' + 'type' => 'bool', + 'serializer' => Boolean::class ]) ->addField([ 'columnName' => 'waiting_list_url', @@ -351,7 +356,8 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor ->addField([ 'columnName' => 'transport_information_enabled', 'fieldName' => 'transportInformationEnabled', - 'type' => 'boolean', + 'type' => 'bool', + 'serializer' => Boolean::class ]) ; diff --git a/sources/AppBundle/Event/Model/Repository/InvoiceRepository.php b/sources/AppBundle/Event/Model/Repository/InvoiceRepository.php index 84fceaa93..0f9b8116c 100644 --- a/sources/AppBundle/Event/Model/Repository/InvoiceRepository.php +++ b/sources/AppBundle/Event/Model/Repository/InvoiceRepository.php @@ -32,6 +32,8 @@ public function saveWithTickets(Invoice $invoice) continue; } $ticket + ->setTransportMode(null) + ->setTransportDistance(null) ->setReference($invoice->getReference()) ->setDate(new \DateTime()) ->setAmount($ticket->getTicketEventType()->getPrice()) diff --git a/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php b/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php index 807768342..5a587e2da 100644 --- a/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php +++ b/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php @@ -7,6 +7,7 @@ use AppBundle\Event\Model\Speaker; use AppBundle\Event\Model\Talk; use Assert\Assertion; +use CCMBenchmark\Ting\Driver\Mysqli\Serializer\Boolean; use CCMBenchmark\Ting\Repository\CollectionInterface; use CCMBenchmark\Ting\Repository\HydratorSingleObject; use CCMBenchmark\Ting\Repository\Metadata; @@ -264,12 +265,14 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor ->addField([ 'columnName' => 'will_attend_speakers_diner', 'fieldName' => 'willAttendSpeakersDiner', - 'type' => 'bool' + 'type' => 'bool', + 'serializer' => Boolean::class ]) ->addField([ 'columnName' => 'has_special_diet', 'fieldName' => 'hasSpecialDiet', - 'type' => 'bool' + 'type' => 'bool', + 'serializer' => Boolean::class ]) ->addField([ 'columnName' => 'special_diet_description', diff --git a/sources/AppBundle/Event/Model/Repository/TalkRepository.php b/sources/AppBundle/Event/Model/Repository/TalkRepository.php index ed7e042aa..99624eb04 100644 --- a/sources/AppBundle/Event/Model/Repository/TalkRepository.php +++ b/sources/AppBundle/Event/Model/Repository/TalkRepository.php @@ -390,12 +390,14 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor ->addField([ 'columnName' => 'video_has_fr_subtitles', 'fieldName' => 'videoHasFrSubtitles', - 'type' => 'bool' + 'type' => 'bool', + 'serializer' => Boolean::class ]) ->addField([ 'columnName' => 'video_has_en_subtitles', 'fieldName' => 'videoHasEnSubtitles', - 'type' => 'bool' + 'type' => 'bool', + 'serializer' => Boolean::class ]) ->addField([ 'columnName' => 'slides_url', diff --git a/sources/AppBundle/Event/Model/Repository/TicketEventTypeRepository.php b/sources/AppBundle/Event/Model/Repository/TicketEventTypeRepository.php index 36c4f4ea3..089524ff8 100644 --- a/sources/AppBundle/Event/Model/Repository/TicketEventTypeRepository.php +++ b/sources/AppBundle/Event/Model/Repository/TicketEventTypeRepository.php @@ -73,8 +73,8 @@ public function update(TicketEventType $ticketEventType) 'id_tarif' => $ticketEventType->getTicketTypeId(), 'id_event' => $ticketEventType->getEventId(), 'price' => $ticketEventType->getPrice(), - 'date_start' => $ticketEventType->getDateStart()->format(\DateTime::ATOM), - 'date_end' => $ticketEventType->getDateEnd()->format(\DateTime::ATOM), + 'date_start' => $ticketEventType->getDateStart()->format('Y-m-d H:i:s'), + 'date_end' => $ticketEventType->getDateEnd()->format('Y-m-d H:i:s'), 'description' => $ticketEventType->getDescription(), 'max_tickets' => $ticketEventType->getMaxTickets() ]); diff --git a/sources/AppBundle/Event/Model/Talk.php b/sources/AppBundle/Event/Model/Talk.php index 96edf48ad..bd7a2227e 100644 --- a/sources/AppBundle/Event/Model/Talk.php +++ b/sources/AppBundle/Event/Model/Talk.php @@ -162,10 +162,10 @@ class Talk implements NotifyPropertyInterface private $useMarkdown = true; /** - * @var bool|null + * @var bool * @Assert\NotNull() */ - private $hasAllowedToSharingWithLocalOffices = null; + private $hasAllowedToSharingWithLocalOffices = false; /** * @return int diff --git a/sources/AppBundle/Event/Model/Ticket.php b/sources/AppBundle/Event/Model/Ticket.php index 4b83e4630..565475920 100644 --- a/sources/AppBundle/Event/Model/Ticket.php +++ b/sources/AppBundle/Event/Model/Ticket.php @@ -253,7 +253,7 @@ class Ticket implements NotifyPropertyInterface protected $nearestOffice; /** - * @var null|string + * @var null|int */ protected $transportMode; @@ -787,7 +787,7 @@ public function setNearestOffice($nearestOffice) } /** - * @return null|string + * @return null|int */ public function getTransportMode() { @@ -795,7 +795,7 @@ public function getTransportMode() } /** - * @param null|string $transportMode + * @param null|int $transportMode * * @return $this */ From 7e1c06a54d7d3c2837f28e407e70827a5e675ba4 Mon Sep 17 00:00:00 2001 From: Albin Kester <83301974+stakovicz@users.noreply.github.com> Date: Fri, 6 Dec 2024 20:47:04 +0100 Subject: [PATCH 3/4] afup#1437 fix article save (#1567) --- htdocs/pages/administration/site_articles.php | 1 + sources/Afup/Corporate/Article.php | 12 ++++++------ .../Admin/Site/AdminSiteArticles.feature | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/htdocs/pages/administration/site_articles.php b/htdocs/pages/administration/site_articles.php index 51555adac..939bed4e9 100755 --- a/htdocs/pages/administration/site_articles.php +++ b/htdocs/pages/administration/site_articles.php @@ -126,6 +126,7 @@ function checkNoSpace($value): bool $formulaire->addRule('titre' , 'Titre manquant' , 'required'); $formulaire->addRule('contenu' , 'Contenu manquant' , 'required'); $formulaire->addRule('raccourci' , 'Raccourci manquant' , 'required'); + $formulaire->addRule('id_site_rubrique' , 'Rubrique manquante' , 'required'); $formulaire->registerRule('checkNoSpace', 'callback', 'checkNoSpace'); $formulaire->addRule('raccourci', 'Ne doit pas contenir d\'espace', 'checkNoSpace', true); diff --git a/sources/Afup/Corporate/Article.php b/sources/Afup/Corporate/Article.php index c724b2746..0b0332efd 100644 --- a/sources/Afup/Corporate/Article.php +++ b/sources/Afup/Corporate/Article.php @@ -230,7 +230,7 @@ function modifier() $requete = 'UPDATE afup_site_article SET id_site_rubrique = ' . $this->bdd->echapper($this->id_site_rubrique) . ', - id_personne_physique = ' . $this->bdd->echapper($this->id_personne_physique) . ', + id_personne_physique = ' . $this->bdd->echapper($this->id_personne_physique ?: null) . ', titre = ' . $this->bdd->echapper($this->titre) . ', raccourci = ' . $this->bdd->echapper($this->raccourci) . ', chapeau = ' . $this->bdd->echapper($this->chapeau) . ', @@ -238,8 +238,8 @@ function modifier() type_contenu = ' . $this->bdd->echapper($this->type_contenu) . ', position = ' . $this->bdd->echapper($this->position) . ', date = ' . $this->bdd->echapper($this->date) . ', - theme = ' . $this->bdd->echapper($this->theme) . ', - id_forum = ' . $this->bdd->echapper($this->id_forum) . ', + theme = ' . $this->bdd->echapper($this->theme ?: null) . ', + id_forum = ' . $this->bdd->echapper($this->id_forum ?: null) . ', etat = ' . $this->bdd->echapper($this->etat) . ' WHERE id = ' . $this->bdd->echapper($this->id); @@ -252,7 +252,7 @@ function inserer() $requete = 'INSERT INTO afup_site_article SET id_site_rubrique = ' . $this->bdd->echapper($this->id_site_rubrique) . ', - id_personne_physique = ' . $this->bdd->echapper($this->id_personne_physique) . ', + id_personne_physique = ' . $this->bdd->echapper($this->id_personne_physique ?: null) . ', titre = ' . $this->bdd->echapper($this->titre) . ', raccourci = ' . $this->bdd->echapper($this->raccourci) . ', chapeau = ' . $this->bdd->echapper($this->chapeau) . ', @@ -260,8 +260,8 @@ function inserer() type_contenu = ' . $this->bdd->echapper($this->type_contenu) . ', position = ' . $this->bdd->echapper($this->position) . ', date = ' . $this->bdd->echapper($this->date) . ', - theme = ' . $this->bdd->echapper($this->theme) . ', - id_forum = ' . $this->bdd->echapper($this->id_forum) . ', + theme = ' . $this->bdd->echapper($this->theme ?: null) . ', + id_forum = ' . $this->bdd->echapper($this->id_forum ?: null) . ', etat = ' . $this->bdd->echapper($this->etat); if ($this->id > 0) { $requete .= ', id = ' . $this->bdd->echapper($this->id); diff --git a/tests/behat/features/Admin/Site/AdminSiteArticles.feature b/tests/behat/features/Admin/Site/AdminSiteArticles.feature index 2bbdee33e..3a0b7b695 100644 --- a/tests/behat/features/Admin/Site/AdminSiteArticles.feature +++ b/tests/behat/features/Admin/Site/AdminSiteArticles.feature @@ -1,5 +1,21 @@ Feature: Administration - Partie Site + Scenario: Ajout d'un article avec le minimum d'info + Given I am logged in as admin and on the Administration + And I follow "Articles" + Then I should see "Liste des articles" + And I should see "Actualités" + When I follow "Ajouter" + Then I should see "Ajouter un article" + And I fill in "titre" with "Le titre mini" + And I fill in "contenu" with "Le contenu mini" + And I fill in "raccourci" with "url-article-mini" + And I select "Actualités" from "id_site_rubrique" + And I select "9" from "position" + And I press "Ajouter" + When I should see "Liste des articles" + Then the ".content table" element should contain "Le titre mini" + @reloadDbWithTestData Scenario: Ajout/modification/suppression d'un article Given I am logged in as admin and on the Administration From 095c856f305cfd67e3ad2747e1983332f1188fb1 Mon Sep 17 00:00:00 2001 From: Adrien Gallou Date: Sun, 8 Dec 2024 16:28:38 +0100 Subject: [PATCH 4/4] correction de la modification d'inscription MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nous avions une erreur 500 lors de la modification d'une inscription. Cela car il manquait un espace avant le where. En effet, nous nous retrouvions avec une requête comme celui-ci : ``` facturation='0', transport_mode=10, transport_distance=0WHERE id=16411 ``` On corrige cela en ajoutant un espace. --- sources/Afup/Forum/Inscriptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/Afup/Forum/Inscriptions.php b/sources/Afup/Forum/Inscriptions.php index 2f1934566..27a2c96b2 100644 --- a/sources/Afup/Forum/Inscriptions.php +++ b/sources/Afup/Forum/Inscriptions.php @@ -286,7 +286,7 @@ function modifierInscription($id, $reference, $type_inscription, $civilite, $nom $requete .= ' facturation=' . $this->_bdd->echapper($facturation) . ','; $requete .= ' transport_mode=' . $this->_bdd->echapper($transportMode) . ','; $requete .= ' transport_distance=' . $this->_bdd->echapper($transportDistance); - $requete .= 'WHERE'; + $requete .= ' WHERE'; $requete .= ' id=' . $id; $this->modifierEtatInscription($reference, $etat);