Installation du module MailJet + on prépare le terrain pour la gestion des fiches recette
This commit is contained in:
24
local/modules/Mailjet/Config/config.xml
Normal file
24
local/modules/Mailjet/Config/config.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<config xmlns="http://thelia.net/schema/dic/config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
|
||||
|
||||
<forms>
|
||||
<form name="mailjet.configuration" class="Mailjet\Form\MailjetConfigurationForm" />
|
||||
</forms>
|
||||
|
||||
<services>
|
||||
<service id="action.mailjet.newsletter" class="Mailjet\EventListeners\NewsletterListener">
|
||||
<argument type="service" id="thelia.translator" />
|
||||
|
||||
<tag name="kernel.event_subscriber" />
|
||||
</service>
|
||||
</services>
|
||||
|
||||
<hooks>
|
||||
<hook id="mailjet.configuration.hook" class="Mailjet\Hook\HookManager" scope="request">
|
||||
<tag name="hook.event_listener" event="module.configuration" type="back" method="onModuleConfiguration" />
|
||||
</hook>
|
||||
</hooks>
|
||||
</config>
|
||||
24
local/modules/Mailjet/Config/module.xml
Normal file
24
local/modules/Mailjet/Config/module.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module xmlns="http://thelia.net/schema/dic/module"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_1.xsd">
|
||||
<fullnamespace>Mailjet\Mailjet</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Mailjet</title>
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Mailjet</title>
|
||||
</descriptive>
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>1.3.2</version>
|
||||
<author>
|
||||
<name>Benjamin Perche, Franck Allimant</name>
|
||||
<email>bperche@openstudio.fr, thelia@cqfdev.fr</email>
|
||||
</author>
|
||||
<type>classic</type>
|
||||
<thelia>2.3.4</thelia>
|
||||
<stability>other</stability>
|
||||
</module>
|
||||
11
local/modules/Mailjet/Config/routing.xml
Normal file
11
local/modules/Mailjet/Config/routing.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
<!-- Thelia 2.0 backward compatibility -->
|
||||
|
||||
<route id="mailjet.save" path="/admin/module/Mailjet" methods="post">
|
||||
<default key="_controller">Mailjet\Controller\MailjetConfigController::saveAction</default>
|
||||
</route>
|
||||
</routes>
|
||||
28
local/modules/Mailjet/Config/schema.xml
Normal file
28
local/modules/Mailjet/Config/schema.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<database defaultIdMethod="native" name="thelia">
|
||||
<table name="mailjet_newsletter" namespace="Mailjet\Model">
|
||||
<column name="id" autoIncrement="true" type="INTEGER" required="true" primaryKey="true" />
|
||||
<column name="mailjet_id" type="VARCHAR" size="255" required="true" />
|
||||
<column name="email" type="VARCHAR" size="255" required="true" />
|
||||
<column name="relation_id" type="VARCHAR" size="255" />
|
||||
|
||||
<index name="idx_mailjet_newsletter_email">
|
||||
<index-column name="email" />
|
||||
</index>
|
||||
<index name="idx_mailjet_newsletter_relation_id">
|
||||
<index-column name="relation_id" />
|
||||
</index>
|
||||
|
||||
<unique name="email_UNIQUE">
|
||||
<unique-column name="email" />
|
||||
</unique>
|
||||
<unique name="relation_id_UNIQUE">
|
||||
<unique-column name="relation_id" />
|
||||
</unique>
|
||||
</table>
|
||||
|
||||
<!--
|
||||
See propel documentation on http://propelorm.org for all information about schema file
|
||||
-->
|
||||
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
|
||||
</database>
|
||||
26
local/modules/Mailjet/Config/thelia.sql
Normal file
26
local/modules/Mailjet/Config/thelia.sql
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
# This is a fix for InnoDB in MySQL >= 4.1.x
|
||||
# It "suspends judgement" for fkey relationships until are tables are set.
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- mailjet_newsletter
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `mailjet_newsletter`;
|
||||
|
||||
CREATE TABLE `mailjet_newsletter`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`mailjet_id` VARCHAR(255) NOT NULL,
|
||||
`email` VARCHAR(255) NOT NULL,
|
||||
`relation_id` VARCHAR(255),
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `email_UNIQUE` (`email`),
|
||||
UNIQUE INDEX `relation_id_UNIQUE` (`relation_id`),
|
||||
INDEX `idx_mailjet_newsletter_email` (`email`),
|
||||
INDEX `idx_mailjet_newsletter_relation_id` (`relation_id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
22
local/modules/Mailjet/Config/update/1.3.sql
Normal file
22
local/modules/Mailjet/Config/update/1.3.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
# This is a fix for InnoDB in MySQL >= 4.1.x
|
||||
# It "suspends judgement" for fkey relationships until are tables are set.
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- mailjet_newsletter
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
ALTER TABLE `mailjet_newsletter` MODIFY `relation_id` INT;
|
||||
|
||||
ALTER TABLE `mailjet_newsletter` MODIFY `id` VARCHAR(255);
|
||||
|
||||
ALTER TABLE `mailjet_newsletter` CHANGE `id` `mailjet_id` VARCHAR(255);
|
||||
|
||||
ALTER TABLE `mailjet_newsletter` ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT UNIQUE FIRST;
|
||||
|
||||
ALTER TABLE `mailjet_newsletter`
|
||||
DROP PRIMARY KEY,
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user