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:
40
local/modules/ColissimoWs/Config/config.xml
Normal file
40
local/modules/ColissimoWs/Config/config.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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="colissimows.orders-not-sent" class="ColissimoWs\Loop\OrdersNotYetSentLoop" />
|
||||
<loop name="colissimows.label-info" class="ColissimoWs\Loop\ColissimoWsLabelInfo" />
|
||||
<loop name="colissimows.price-slices" class="ColissimoWs\Loop\PriceSlicesLoop" />
|
||||
<loop name="colissimows.freeshipping" class="ColissimoWs\Loop\ColissimoWsFreeShippingLoop" />
|
||||
</loops>
|
||||
|
||||
<forms>
|
||||
<form name="colissimows_configuration_form" class="ColissimoWs\Form\ConfigurationForm" />
|
||||
<form name="colissimows_export_form" class="ColissimoWs\Form\LabelGenerationForm" />
|
||||
<form name="colissimows.freeshipping.form" class="ColissimoWs\Form\FreeShippingForm" />
|
||||
</forms>
|
||||
|
||||
<services>
|
||||
<service id="colissimows.label_generator" class="ColissimoWs\EventListeners\ShippingLabelGenerator">
|
||||
<argument type="service" id="request_stack" />
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
<service id="colissimows.notification_mail" class="ColissimoWs\EventListeners\ShippingNotificationSender">
|
||||
<argument type="service" id="thelia.parser" />
|
||||
<argument type="service" id="mailer"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
<hooks>
|
||||
<hook id="colissimows.hooks" class="ColissimoWs\Hook\HookManager">
|
||||
<tag name="hook.event_listener" event="module.configuration" type="back" method="onModuleConfigure" />
|
||||
<tag name="hook.event_listener" event="main.top-menu-tools" type="back" method="onMainTopMenuTools" />
|
||||
<tag name="hook.event_listener" event="module.config-js" type="back" method="onModuleConfigJs" />
|
||||
</hook>
|
||||
</hooks>
|
||||
</config>
|
||||
32
local/modules/ColissimoWs/Config/module.xml
Normal file
32
local/modules/ColissimoWs/Config/module.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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>ColissimoWs\ColissimoWs</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Home delivery with Colissimo</title>
|
||||
<subtitle>Use Colissimo web services to get labels and tracking numbers</subtitle>
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Livraison à domicile avec Colissimo</title>
|
||||
<subtitle>Utilisez les web services Colissimo pour obtenir les étiquettes d'affranchissement et les numéros de suivi.</subtitle>
|
||||
</descriptive>
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>1.1.6</version>
|
||||
<authors>
|
||||
<author>
|
||||
<name>Franck Allimant</name>
|
||||
<company>CQFDev</company>
|
||||
<email>thelia@cqfdev.fr</email>
|
||||
<website>www.cqfdev.fr</website>
|
||||
</author>
|
||||
</authors>
|
||||
<type>delivery</type>
|
||||
<thelia>2.3.4</thelia>
|
||||
<stability>other</stability>
|
||||
<mandatory>0</mandatory>
|
||||
<hidden>0</hidden>
|
||||
</module>
|
||||
50
local/modules/ColissimoWs/Config/routing.xml
Normal file
50
local/modules/ColissimoWs/Config/routing.xml
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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="colissimows.config" path="/admin/module/colissimows/configure">
|
||||
<default key="_controller">ColissimoWs\Controller\ConfigurationController::configure</default>
|
||||
</route>
|
||||
|
||||
<route id="colissimows.export" path="/admin/module/colissimows/export">
|
||||
<default key="_controller">ColissimoWs\Controller\LabelController::export</default>
|
||||
</route>
|
||||
|
||||
<route id="colissimows.label" path="/admin/module/colissimows/label/{orderId}">
|
||||
<default key="_controller">ColissimoWs\Controller\LabelController::getLabel</default>
|
||||
<requirement key="orderId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="colissimows.customs-invoice" path="/admin/module/colissimows/customs-invoice/{orderId}">
|
||||
<default key="_controller">ColissimoWs\Controller\LabelController::getCustomsInvoice</default>
|
||||
<requirement key="orderId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="colissimows.clear_label" path="/admin/module/colissimows/label/clear/{orderId}">
|
||||
<default key="_controller">ColissimoWs\Controller\LabelController::clearLabel</default>
|
||||
<requirement key="orderId">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="colissimows.get_zip" path="/admin/module/colissimows/labels-zip/{base64EncodedZipFilename}">
|
||||
<default key="_controller">ColissimoWs\Controller\LabelController::getLabelZip</default>
|
||||
<requirement key="base64ZipFilePath">[A-Za-z0-9]+</requirement>
|
||||
</route>
|
||||
|
||||
<!-- Price Slices -->
|
||||
|
||||
<route id="colissimows.toggle.freeshipping" path="/admin/module/colissimows/freeshipping" methods="post">
|
||||
<default key="_controller">ColissimoWs\Controller\FreeShippingController::toggleFreeShippingActivation</default>
|
||||
</route>
|
||||
|
||||
<route id="colissimows.add.price-slice" path="/admin/module/colissimows/price-slice/save" methods="post">
|
||||
<default key="_controller">ColissimoWs\Controller\PriceSliceController::savePriceSliceAction</default>
|
||||
</route>
|
||||
|
||||
<route id="colissimows.update.price-slice" path="/admin/module/colissimows/price-slice/delete" methods="post">
|
||||
<default key="_controller">ColissimoWs\Controller\PriceSliceController::deletePriceSliceAction</default>
|
||||
</route>
|
||||
|
||||
|
||||
</routes>
|
||||
45
local/modules/ColissimoWs/Config/schema.xml
Normal file
45
local/modules/ColissimoWs/Config/schema.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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="colissimows_label" namespace="ColissimoWs\Model">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="order_id" type="INTEGER" required="true"/>
|
||||
<column name="order_ref" type="VARCHAR" size="255" required="true"/>
|
||||
<column name="error" type="BOOLEAN" required="true" default="0" />
|
||||
<column name="error_message" type="VARCHAR" size="255" default="" />
|
||||
<column name="tracking_number" type="VARCHAR" size="64" default="" />
|
||||
<column name="label_data" type="CLOB" />
|
||||
<column name="label_type" type="VARCHAR" size="4" />
|
||||
<column name="weight" type="float" required="true" />
|
||||
<column name="signed" type="BOOLEAN" default="0"/>
|
||||
<column name="with_customs_invoice" type="BOOLEAN" required="true" default="0" />
|
||||
|
||||
<foreign-key foreignTable="order" name="fk_colissimows_label_order" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="order_id" />
|
||||
</foreign-key>
|
||||
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
|
||||
<table name="colissimows_price_slices" namespace="ColissimoWs\Model">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="area_id" type="INTEGER" required="true"/>
|
||||
<column name="max_weight" type="FLOAT"/>
|
||||
<column name="max_price" type="FLOAT"/>
|
||||
<column name="shipping" type="FLOAT" required="true"/>
|
||||
<column name="franco_min_price" type="FLOAT" />
|
||||
|
||||
<foreign-key foreignTable="area" name="fk_colissimows_price_slices_area_id" onDelete="RESTRICT" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="area_id" />
|
||||
</foreign-key>
|
||||
</table>
|
||||
|
||||
<table name="colissimows_freeshipping" namespace="ColissimoWs\Model">
|
||||
<column name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="active" type="BOOLEAN" default="0"/>
|
||||
</table>
|
||||
|
||||
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
|
||||
</database>
|
||||
2
local/modules/ColissimoWs/Config/sqldb.map
Normal file
2
local/modules/ColissimoWs/Config/sqldb.map
Normal file
@@ -0,0 +1,2 @@
|
||||
# Sqlfile -> Database map
|
||||
thelia.sql=thelia
|
||||
73
local/modules/ColissimoWs/Config/thelia.sql
Normal file
73
local/modules/ColissimoWs/Config/thelia.sql
Normal file
@@ -0,0 +1,73 @@
|
||||
|
||||
# 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;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- colissimows_label
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `colissimows_label`;
|
||||
|
||||
CREATE TABLE `colissimows_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(64) DEFAULT '',
|
||||
`label_data` LONGTEXT,
|
||||
`label_type` VARCHAR(4),
|
||||
`weight` FLOAT NOT NULL,
|
||||
`signed` TINYINT(1) DEFAULT 0,
|
||||
`with_customs_invoice` TINYINT(1) DEFAULT 0 NOT NULL,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_colissimows_label_order` (`order_id`),
|
||||
CONSTRAINT `fk_colissimows_label_order`
|
||||
FOREIGN KEY (`order_id`)
|
||||
REFERENCES `order` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- colissimows_price_slices
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `colissimows_price_slices`;
|
||||
|
||||
CREATE TABLE `colissimows_price_slices`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`area_id` INTEGER NOT NULL,
|
||||
`max_weight` FLOAT,
|
||||
`max_price` FLOAT,
|
||||
`shipping` FLOAT NOT NULL,
|
||||
`franco_min_price` FLOAT,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_colissimows_price_slices_area_id` (`area_id`),
|
||||
CONSTRAINT `fk_colissimows_price_slices_area_id`
|
||||
FOREIGN KEY (`area_id`)
|
||||
REFERENCES `area` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE RESTRICT
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- colissimows_freeshipping
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `colissimows_freeshipping`;
|
||||
|
||||
CREATE TABLE `colissimows_freeshipping`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`active` TINYINT(1) DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user