Ajout du module CustomDelivery v 1.0.7 (avant le AbstractDeliveryModuleWithState)

This commit is contained in:
2023-12-08 16:24:23 +01:00
parent c30f59d2e4
commit 4e8ac75bad
32 changed files with 4418 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?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">
<loops>
<loop name="custom-delivery-slice" class="CustomDelivery\Loop\CustomDeliverySliceLoop" />
</loops>
<forms>
<form name="customdelivery.configuration.form" class="CustomDelivery\Form\ConfigurationForm" />
<form name="customdelivery.slice.form" class="CustomDelivery\Form\SliceForm" />
</forms>
<services>
<service id="customdelivery.events" class="CustomDelivery\EventListeners\CustomDeliveryEvents" scope="request">
<argument type="service" id="thelia.parser" />
<argument type="service" id="mailer"/>
<tag name="kernel.event_subscriber"/>
</service>
</services>
<hooks>
<hook id="customdelivery.hook" class="CustomDelivery\Hook\HookManager" scope="request">
<!-- Back -->
<tag name="hook.event_listener" event="module.configuration" type="back" />
<tag name="hook.event_listener" event="module.config-js" type="back" />
</hook>
</hooks>
</config>

View 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>CustomDelivery\CustomDelivery</fullnamespace>
<descriptive locale="en_US">
<title>Custom Delivery</title>
</descriptive>
<descriptive locale="fr_FR">
<title>Livraison Personnalisée</title>
</descriptive>
<languages>
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>1.0.7</version>
<author>
<name>Julien Chanséaume</name>
<email>julien@thelia.net</email>
</author>
<type>delivery</type>
<thelia>2.1.0</thelia>
<stability>prod</stability>
</module>

View File

@@ -0,0 +1,19 @@
<?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">
<route id="customdelivery.admin.update" path="/admin/module/customdelivery/save" methods="post">
<default key="_controller">CustomDelivery\Controller\BackController::saveAction</default>
</route>
<route id="customdelivery.admin.delete" path="/admin/module/customdelivery/delete" methods="post">
<default key="_controller">CustomDelivery\Controller\BackController::deleteAction</default>
</route>
<route id="customdelivery.admin.configuration" path="/admin/module/customdelivery/configuration" methods="post">
<default key="_controller">CustomDelivery\Controller\BackController::saveConfigurationAction</default>
</route>
</routes>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="thelia"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../core/vendor/propel/propel/resources/xsd/database.xsd" >
<table name="custom_delivery_slice" namespace="CustomDelivery\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="area_id" type="INTEGER" required="true" />
<column defaultValue="0" name="price_max" type="FLOAT" />
<column defaultValue="0" name="weight_max" type="FLOAT" />
<column defaultValue="0" name="price" type="FLOAT" />
<foreign-key foreignTable="area" name="fk_area_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="area_id" />
</foreign-key>
</table>
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
</database>

View File

@@ -0,0 +1,2 @@
# Sqlfile -> Database map
thelia.sql=thelia

View File

@@ -0,0 +1,29 @@
# 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;
-- ---------------------------------------------------------------------
-- custom_delivery_slice
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `custom_delivery_slice`;
CREATE TABLE `custom_delivery_slice`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`area_id` INTEGER NOT NULL,
`price_max` FLOAT DEFAULT 0,
`weight_max` FLOAT DEFAULT 0,
`price` FLOAT DEFAULT 0,
PRIMARY KEY (`id`),
INDEX `FI_area_id` (`area_id`),
CONSTRAINT `fk_area_id`
FOREIGN KEY (`area_id`)
REFERENCES `area` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;