Ajout des modules ColissimoWs et ColissimoLabel.php

Ne pas oublier de vérifier si les tables nécessaires sont bien créées en BDD.
This commit is contained in:
2020-05-07 11:45:31 +02:00
parent 28b21af6c8
commit 649c92e52f
114 changed files with 21550 additions and 8312 deletions

View File

@@ -0,0 +1,49 @@
<?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="colissimo-label" class="ColissimoLabel\Loop\ColissimoLabel" />
</loops>
<forms>
<!--
<form name="MyFormName" class="ColissimoLabel\Form\MySuperForm" />
-->
</forms>
<commands>
<!--
<command class="ColissimoLabel\Command\MySuperCommand" />
-->
</commands>
<!--
<services>
</services>
-->
<hooks>
<hook id="colissimo.label.hook.back.order_edit" class="ColissimoLabel\Hook\Back\OrderEditHook">
<tag name="hook.event_listener" event="order.edit-js" type="back" method="onOrderEditJs" />
</hook>
<hook id="colissimo.label.hook.hook.main.in.top.menu.items" class="ColissimoLabel\Hook\Back\MenuHook">
<tag name="hook.event_listener" event="main.in-top-menu-items" type="back" />
</hook>
</hooks>
<!--
<exports>
</exports>
-->
<!--
<imports>
</imports>
-->
</config>

View File

@@ -0,0 +1,28 @@
<?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_2.xsd">
<fullnamespace>ColissimoLabel\ColissimoLabel</fullnamespace>
<descriptive locale="en_US">
<title>Generate the delivery labels for Colissimo</title>
</descriptive>
<descriptive locale="fr_FR">
<title>Genérer les étiquettes de livraison pour Colissimo</title>
</descriptive>
<languages>
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>0.3.4</version>
<authors>
<author>
<name>Gilles Bourgeat</name>
<email>gbourgeat@openstudio.fr</email>
</author>
</authors>
<type>classic</type>
<thelia>2.2.0</thelia>
<stability>beta</stability>
<mandatory>0</mandatory>
<hidden>0</hidden>
</module>

View File

@@ -0,0 +1,31 @@
<?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="colissimolabel.admin.generate.label" path="/admin/module/colissimolabel/order/{orderId}/generate-label" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\OrderController::generateLabelAction</default>
<requirement key="id">[0-9]+</requirement>
</route>
<route id="colissimolabel.admin.get.label" path="/admin/module/colissimolabel/label/{number}" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\OrderController::getLabelAction</default>
<requirement key="number">[0-9A-Z]+</requirement>
</route>
<route id="colissimolabel.admin.get.list-labels" path="/admin/module/colissimolabel/order/{orderId}/ajax-get-labels" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\OrderController::getOrderLabelsAction</default>
<requirement key="id">[0-9]+</requirement>
</route>
<route id="colissimolabel.admin.bordereau.list" path="/admin/module/colissimolabel/bordereau/list" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\BordereauController::listBordereauAction</default>
</route>
<route id="colissimolabel.admin.bordereau.generate" path="/admin/module/colissimolabel/bordereau/generate" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\BordereauController::generateBordereauAction</default>
</route>
<route id="colissimolabel.admin.bordereau.download" path="/admin/module/colissimolabel/bordereau/download" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\BordereauController::downloadBordereauAction</default>
</route>
</routes>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="thelia"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../vendor/propel/propel/resources/xsd/database.xsd" >
<table name="colissimo_label" namespace="ColissimoLabel\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="order_id" type="INTEGER" required="true" />
<column name="weight" type="DECIMAL" scale="2" size="6" defaultValue="0.00" />
<column name="number" type="VARCHAR" size="255" />
<foreign-key foreignTable="order" onDelete="CASCADE" onUpdate="RESTRICT">
<reference local="order_id" foreign="id" />
</foreign-key>
<behavior name="timestampable" />
</table>
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
</database>

View File

@@ -0,0 +1,30 @@
# 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;
-- ---------------------------------------------------------------------
-- colissimo_label
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `colissimo_label`;
CREATE TABLE `colissimo_label`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`order_id` INTEGER NOT NULL,
`weight` DECIMAL(6,2) DEFAULT 0.00,
`number` VARCHAR(255),
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
INDEX `colissimo_label_FI_1` (`order_id`),
CONSTRAINT `colissimo_label_FK_1`
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;