From cc217a1e79b2160bafc03d60c9883606e50e0540 Mon Sep 17 00:00:00 2001 From: Alyssa Date: Thu, 12 Dec 2024 16:28:23 +0100 Subject: [PATCH] user, intervention add --- .idea/dataSources.xml | 47 +------------------- assets/styles/css/intervention.css | 64 ++++++++++++++++++++++++---- migrations/Version20241114151456.php | 43 ------------------- migrations/Version20241128141518.php | 31 -------------- migrations/Version20241205162005.php | 50 ++++++++++++++++++++++ src/Entity/User.php | 5 +-- templates/intervention/add.html.twig | 15 ++++++- 7 files changed, 122 insertions(+), 133 deletions(-) delete mode 100644 migrations/Version20241114151456.php delete mode 100644 migrations/Version20241128141518.php create mode 100644 migrations/Version20241205162005.php diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index c17c05a..c1906c3 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -1,56 +1,11 @@ -<<<<<<< HEAD - + postgresql true org.postgresql.Driver jdbc:postgresql://172.20.96.1:5432/HegreEtConfort -======= -<<<<<<< HEAD -<<<<<<< HEAD - -======= -<<<<<<< HEAD - - postgresql - true - org.postgresql.Driver - jdbc:postgresql://172.20.96.1:5432/ - $ProjectFileDir$ - - - mariadb - true - org.mariadb.jdbc.Driver - jdbc:mariadb://127.0.0.1:3306/hegreconfort -======= - - postgresql - true - org.postgresql.Driver - jdbc:postgresql://172.20.96.1:5432/chauffageproj - $ProjectFileDir$ - - ->>>>>>> 6532d4d88b86c321a212cdc0ca43b2e4770db117 - postgresql - true - org.postgresql.Driver - jdbc:postgresql://172.20.96.1:5432/chauffageproj ->>>>>>> ee236ff74aaac1882a825817d5ce8f692d3bdd0f -======= - - mariadb - true - org.mariadb.jdbc.Driver - jdbc:mariadb://localhost:3306/HegreConfort - - - ->>>>>>> cc65343635c8771e56e2a3304b42ec32f4f91b97 ->>>>>>> d7375d330251cab10a2296bbb292fcdb7cd6e847 $ProjectFileDir$ diff --git a/assets/styles/css/intervention.css b/assets/styles/css/intervention.css index 2121fcd..07e7e76 100644 --- a/assets/styles/css/intervention.css +++ b/assets/styles/css/intervention.css @@ -6,16 +6,16 @@ body { background-color: #7D9599; position: absolute; width: 100%; - height: 80%; + height: 87%; } .background-intervention { background-color: #A0C2C8; position: absolute; - box-shadow: 0 0 30px 1px black; + box-shadow: 0 0 15px 0 black; border-radius: 5%; - margin: 2% 0 0 20%; - width: 60%; + margin: 7% 0 0 15%; + width: 70%; height: 70%; } @@ -24,13 +24,61 @@ body { margin: 1% 0 0 5%; width: 5%; } - -h1 { +.titre { position: absolute; - margin: 5% 0 0 11%; + margin: 2% 0 0 11%; + color: white; +} + +#nom { + position: absolute; + margin: 2% 0 0 5%; + width: 45%; +} +#echecs { + position: absolute; + margin: 6% 0 0 5%; +} +#employesCompetences { + position: absolute; + margin: 10% 0 0 5%; +} +#piece { + position: absolute; + margin: 14% 0 0 5%; +} + +#vehicule { + position: absolute; + margin: 18.5% 0 0 5%; +} +#vehicule1 { + position: absolute; + margin: 19% 0 0 21.5%; +} +#oui { + position: absolute; + margin: 18.5% 0 0 24%; +} +#vehicule2 { + position: absolute; + margin: 19% 0 0 30%; +} +#non { + position: absolute; + margin: 18.5% 0 0 33%; +} + +#date { + position: absolute; + margin: 2% 0 0 70%; +} +#calendar { + position: absolute; + margin: 18.5% 0 0 33%; } .from { position: absolute; - margin: 15% 15% 15% 15%; + margin: 65% 15% 15% 15%; } \ No newline at end of file diff --git a/migrations/Version20241114151456.php b/migrations/Version20241114151456.php deleted file mode 100644 index 34acab8..0000000 --- a/migrations/Version20241114151456.php +++ /dev/null @@ -1,43 +0,0 @@ -addSql('CREATE TABLE fault (id INT AUTO_INCREMENT NOT NULL, wording VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE intervention (id INT AUTO_INCREMENT NOT NULL, wording VARCHAR(255) NOT NULL, timestamp DATETIME NOT NULL, description VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE skill (id INT AUTO_INCREMENT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE stock (id INT AUTO_INCREMENT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, quantity VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE `user` (id INT AUTO_INCREMENT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birth_date DATE NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE vehicle (id INT AUTO_INCREMENT NOT NULL, license_plate VARCHAR(255) NOT NULL, brand VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP TABLE fault'); - $this->addSql('DROP TABLE intervention'); - $this->addSql('DROP TABLE skill'); - $this->addSql('DROP TABLE stock'); - $this->addSql('DROP TABLE `user`'); - $this->addSql('DROP TABLE vehicle'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/migrations/Version20241128141518.php b/migrations/Version20241128141518.php deleted file mode 100644 index ffcd213..0000000 --- a/migrations/Version20241128141518.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('CREATE SCHEMA public'); - } -} diff --git a/migrations/Version20241205162005.php b/migrations/Version20241205162005.php new file mode 100644 index 0000000..9f8bff3 --- /dev/null +++ b/migrations/Version20241205162005.php @@ -0,0 +1,50 @@ +addSql('CREATE SEQUENCE fault_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE intervention_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE stock_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE user_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE vehicle_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('ALTER TABLE "user" ADD roles JSON NOT NULL'); + $this->addSql('ALTER TABLE "user" ALTER email TYPE VARCHAR(180)'); + $this->addSql('ALTER TABLE "user" RENAME COLUMN type TO password'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON "user" (email)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('DROP SEQUENCE fault_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE intervention_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE skill_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE stock_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE user_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE vehicle_id_seq CASCADE'); + $this->addSql('DROP INDEX UNIQ_IDENTIFIER_EMAIL'); + $this->addSql('ALTER TABLE "user" DROP roles'); + $this->addSql('ALTER TABLE "user" ALTER email TYPE VARCHAR(255)'); + $this->addSql('ALTER TABLE "user" RENAME COLUMN password TO type'); + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php index 0be20f0..3ebcbae 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -18,7 +18,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface private ?int $id = null; #[ORM\Column(length: 180)] - private ?string $email = null; + private string $email; #[ORM\Column(length: 255)] private ?string $FirstName = null; @@ -29,9 +29,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface #[ORM\Column(type: Types::DATE_MUTABLE)] private ?\DateTimeInterface $BirthDate = null; - #[ORM\Column(length: 255)] - private ?string $Email = null; - #[ORM\Column(length: 255)] private ?string $Phone = null; /** diff --git a/templates/intervention/add.html.twig b/templates/intervention/add.html.twig index 75d67d8..c80727d 100644 --- a/templates/intervention/add.html.twig +++ b/templates/intervention/add.html.twig @@ -17,9 +17,22 @@
Logo Calendrier -

Créer Une Intervention

+

Créer Une Intervention

+ + + + +

Véhicule nécessaire

+ + + + +

Jour de l'intervention

+ + +
{{ form(form) }}