Quelques nouveaux fichiers et modules en conf

This commit is contained in:
2021-01-25 18:42:52 +01:00
parent 9b4d5e339b
commit af1552b390
212 changed files with 38073 additions and 817 deletions

View File

@@ -0,0 +1,42 @@
<?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="order.comment.comment" class="OrderComment\Loop\OrderCommentLoop"/>
<loop name="order.comment.session.comment" class="OrderComment\Loop\SessionOrderCommentLoop"/>
</loops>
<forms>
<form name="order.comment.form" class="OrderComment\Form\CommentForm" />
</forms>
<services>
<service id="order.comment.order.form" class="OrderComment\EventListeners\OrderFormListener">
<tag name="kernel.event_subscriber"/>
</service>
<service id="order.comment.order.event" class="OrderComment\EventListeners\OrderEventListener">
<argument type="service" id="request_stack" />
<tag name="kernel.event_subscriber"/>
</service>
</services>
<hooks>
<hook id="order.comment.hook.back" class="OrderComment\Hook\BackHook" scope="request">
<tag name="hook.event_listener" type="back" event="order-edit.after-order-product-list" method="onOrderEditAfterOrderProductList"/>
<tag name="hook.event_listener" type="back" event="order-edit.bill-bottom" method="onOrderEditBillBottom"/>
<tag name="hook.event_listener" type="back" event="order.tab-content" method="onOrderTabContent"/>
</hook>
<hook id="order.comment.hook.front" class="OrderComment\Hook\FrontHook" scope="request">
<tag name="hook.event_listener" type="front" event="cart.bottom" method="onCartBottom"/>
<tag name="hook.event_listener" type="front" event="cart.after-javascript-include" method="onCartIncludeJs"/>
<tag name="hook.event_listener" type="front" event="order-delivery.form-bottom" method="onDeliveryFormBottom"/>
</hook>
<hook id="order.comment.hook.pdf" class="OrderComment\Hook\PdfHook" scope="request">
<tag name="hook.event_listener" type="pdf" event="delivery.after-summary" method="onDeliveryAfterSummary"/>
</hook>
</hooks>
</config>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module>
<fullnamespace>OrderComment\OrderComment</fullnamespace>
<descriptive locale="en_US">
<title>Allow customer to add comment to this order</title>
</descriptive>
<descriptive locale="fr_FR">
<title>Permet au client d'ajouter un commentaire à sa commande</title>
</descriptive>
<version>1.2.3</version>
<author>
<name>Vincent Lopes-Vicente</name>
<email>vlopes@openstudio.fr</email>
</author>
<type>classic</type>
<thelia>2.1.</thelia>
<stability>other</stability>
</module>

View 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">
<route id="ordercomment.set.comment" path="/ordercomment/set/comment">
<default key="_controller">OrderComment\Controller\OrderCommentController::setComment</default>
</route>
</routes>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="thelia" namespace="OrderComment\Model">
<table name="order_comment">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="order_id" required="true" type="INTEGER" />
<column name="comment" required="true" type="LONGVARCHAR" />
<foreign-key foreignTable="order" name="fk_order_comment_order_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="order_id" />
</foreign-key>
</table>
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
</database>

View File

@@ -0,0 +1,27 @@
# 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;
-- ---------------------------------------------------------------------
-- order_comment
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `order_comment`;
CREATE TABLE `order_comment`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`order_id` INTEGER NOT NULL,
`comment` TEXT NOT NULL,
PRIMARY KEY (`id`),
INDEX `FI_order_comment_order_id` (`order_id`),
CONSTRAINT `fk_order_comment_order_id`
FOREIGN KEY (`order_id`)
REFERENCES `order` (`id`)
ON UPDATE RESTRICT
ON DELETE CASCADE
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;