[11/05/2025] On remplace les modules Colissimo par le combo ColissimoHomeDelivery + ColissimoPickupPoint + ColissimoLabel

This commit is contained in:
2025-05-11 23:38:10 +02:00
parent a09aa11f16
commit 49b1a63ecc
1528 changed files with 18449 additions and 62 deletions

View File

@@ -0,0 +1,60 @@
<?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="colissimolabel.orders-not-sent" class="ColissimoLabel\Loop\OrdersNotSentLoop" />
<loop name="colissimolabel.label-info" class="ColissimoLabel\Loop\ColissimoLabelInfo" />
</loops>
<forms>
<form name="colissimolabel.configure" class="ColissimoLabel\Form\ConfigureColissimoLabel" />
<form name="colissimolabel_export_form" class="ColissimoLabel\Form\LabelGenerationForm" />
</forms>
<commands>
<!--
<command class="ColissimoLabel\Command\MySuperCommand" />
-->
</commands>
<services>
<service id="colissimolabel.update.oder.address.listener" class="ColissimoLabel\EventListeners\UpdateDeliveryAddressListener">
<argument type="service" id="event_dispatcher"/>
<argument type="service" id="service_container"/>
<tag name="kernel.event_subscriber"/>
</service>
<service id="colissimolabel.generate.label.service" class="ColissimoLabel\Service\LabelService">
<argument type="service" id="event_dispatcher"/>
</service>
<service id="picking.colissimolabel.generate.label.listener" class="ColissimoLabel\EventListeners\GenerateLabelListener">
<argument type="service" id="colissimolabel.generate.label.service"/>
<tag name="kernel.event_subscriber"/>
</service>
</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,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_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>1.0.4</version>
<author>
<name>Gilles Bourgeat</name>
<email>gbourgeat@openstudio.fr</email>
</author>
<type>classic</type>
<thelia>2.2.0</thelia>
<stability>beta</stability>
</module>

View File

@@ -0,0 +1,63 @@
<?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.export" path="/admin/module/colissimolabel/export">
<default key="_controller">ColissimoLabel\Controller\Admin\OrderController::generateLabelAction</default>
</route>
<route id="colissimolabel.get_zip" path="/admin/module/colissimolabel/labels-zip/{base64EncodedZipFilename}">
<default key="_controller">ColissimoLabel\Controller\Admin\OrderController::getLabelZip</default>
<requirement key="base64ZipFilePath">[A-Za-z0-9]+</requirement>
</route>
<route id="colissimolabel.admin.get.label" path="/admin/module/colissimolabel/label/{number}">
<default key="_controller">ColissimoLabel\Controller\Admin\OrderController::getLabelAction</default>
<requirement key="number">[0-9A-Z]+</requirement>
</route>
<route id="colissimolabel.admin.get.customs.invoice" path="/admin/module/colissimolabel/customs-invoice/{orderId}">
<default key="_controller">ColissimoLabel\Controller\Admin\OrderController::getCustomsInvoiceAction</default>
<requirement key="orderId">[0-9A-Z]+</requirement>
</route>
<route id="colissimolabel.admin.delete.label" path="/admin/module/colissimolabel/label/delete/{number}" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\OrderController::deleteLabelAction</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/bordereaux" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\BordereauController::listBordereauAction</default>
</route>
<route id="colissimolabel.admin.configuration" path="/admin/module/colissimolabel/configuration" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\ConfigurationController::renderConfigPageAction</default>
</route>
<route id="colissimolabel.admin.configuration.save" path="/admin/module/colissimolabel/configuration/save" methods="post">
<default key="_controller">ColissimoLabel\Controller\Admin\ConfigurationController::saveConfig</default>
</route>
<route id="colissimolabel.admin.labels" path="/admin/module/colissimolabel/labels" methods="get">
<default key="_controller">ColissimoLabel\Controller\Admin\BordereauController::listLabelsAction</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>
<route id="colissimolabel.admin.bordereau.delete" path="/admin/module/colissimolabel/bordereau/delete">
<default key="_controller">ColissimoLabel\Controller\Admin\BordereauController::deleteBordereauAction</default>
</route>
</routes>

View File

@@ -0,0 +1,26 @@
<?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" /> <!-- Old -->
<column name="order_id" type="INTEGER" required="true" /> <!-- Old -->
<column name="order_ref" type="VARCHAR" size="255" required="true"/> <!-- New -->
<column name="error" type="BOOLEAN" required="true" default="0" /> <!-- New -->
<column name="error_message" type="VARCHAR" size="255" default="" /> <!-- New -->
<column name="tracking_number" type="VARCHAR" size="255" /> <!-- Old - To Remove & change to tracking number -->
<column name="label_type" type="VARCHAR" size="4" /> <!-- New -->
<column name="weight" type="DECIMAL" scale="2" size="6" defaultValue="0.00" /> <!-- Old -->
<column name="signed" type="BOOLEAN" required="true" default="0" /> <!-- Old : Ex tinyint without default value -->
<column name="with_customs_invoice" type="BOOLEAN" required="true" default="0" /> <!-- New -->
<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,2 @@
# Sqlfile -> Database map
thelia.sql=thelia

View File

@@ -0,0 +1,36 @@
# 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,
`order_ref` VARCHAR(255) NOT NULL,
`error` TINYINT(1) DEFAULT 0 NOT NULL,
`error_message` VARCHAR(255) DEFAULT '',
`tracking_number` VARCHAR(255),
`label_type` VARCHAR(4),
`weight` DECIMAL(6,2) DEFAULT 0.00,
`signed` TINYINT(1) DEFAULT 0 NOT NULL,
`with_customs_invoice` TINYINT(1) DEFAULT 0 NOT NULL,
`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;

View File

@@ -0,0 +1,12 @@
# 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
-- ---------------------------------------------------------------------
ALTER TABLE `colissimo_label` ADD COLUMN `signed` TINYINT NOT NULL AFTER `weight`;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -0,0 +1,18 @@
# 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
-- ---------------------------------------------------------------------
ALTER TABLE `colissimo_label` ADD COLUMN `order_ref` VARCHAR(255) NOT NULL AFTER `order_id`;
ALTER TABLE `colissimo_label` ADD COLUMN `error` TINYINT NOT NULL AFTER `order_id`;
ALTER TABLE `colissimo_label` ADD COLUMN `error_message` VARCHAR(255) AFTER `order_ref`;
ALTER TABLE `colissimo_label` CHANGE COLUMN `number` `tracking_number` VARCHAR(255) NOT NULL;
ALTER TABLE `colissimo_label` ADD COLUMN `label_type` VARCHAR(4) NOT NULL AFTER `error_message`;
ALTER TABLE `colissimo_label` ADD COLUMN `with_customs_invoice` TINYINT NOT NULL AFTER `signed`;
ALTER TABLE `colissimo_label` MODIFY `tracking_number` VARCHAR(255) AFTER `error_message`;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;