D'autres fichiers en conf
This commit is contained in:
49
local/modules/PaymentCondition/Config/config.xml
Normal file
49
local/modules/PaymentCondition/Config/config.xml
Normal 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>
|
||||
<!-- sample definition
|
||||
<loop name="MySuperLoop" class="PaymentCondition\Loop\MySuperLoop" />
|
||||
-->
|
||||
</loops>
|
||||
|
||||
<forms>
|
||||
<!--
|
||||
<form name="MyFormName" class="PaymentCondition\Form\MySuperForm" />
|
||||
-->
|
||||
</forms>
|
||||
|
||||
<commands>
|
||||
<!--
|
||||
<command class="PaymentCondition\Command\MySuperCommand" />
|
||||
-->
|
||||
</commands>
|
||||
|
||||
<services>
|
||||
<service id="payment_condition.payment.loop.extends" class="PaymentCondition\EventListeners\PaymentLoopExtend" scope="request">
|
||||
<argument type="service" id="request_stack"/>
|
||||
<tag name="kernel.event_subscriber" />
|
||||
</service>
|
||||
</services>
|
||||
|
||||
<hooks>
|
||||
<hook id="payment_condition.customer.edit" class="PaymentCondition\Hook\CustomerEditHook">
|
||||
<tag name="hook.event_listener" event="customer.edit" type="back" method="onCustomerEdit" />
|
||||
</hook>
|
||||
</hooks>
|
||||
|
||||
<!--
|
||||
<exports>
|
||||
|
||||
</exports>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<imports>
|
||||
|
||||
</imports>
|
||||
-->
|
||||
</config>
|
||||
41
local/modules/PaymentCondition/Config/module.xml
Normal file
41
local/modules/PaymentCondition/Config/module.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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>PaymentCondition\PaymentCondition</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Allow to manage condition for display payment module</title>
|
||||
<!--
|
||||
<subtitle></subtitle>
|
||||
<description></description>
|
||||
<postscriptum></postscriptum>
|
||||
-->
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Permet de génerer des conditions d'affichages pour les modules de paiements</title>
|
||||
</descriptive>
|
||||
<!-- <logo></logo> -->
|
||||
<!--<images-folder>images</images-folder>-->
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>1.0.0</version>
|
||||
<authors>
|
||||
<author>
|
||||
<name>Vincent Lopes-Vicente</name>
|
||||
<email>vlopes@openstudio.fr</email>
|
||||
</author>
|
||||
</authors>
|
||||
<type>classic</type>
|
||||
<!--
|
||||
module dependencies
|
||||
<required>
|
||||
<module version=">=0.1">Front</module>
|
||||
<module version="~1.0">HookCart</module>
|
||||
<module version=">0.2">HookSearch</module>
|
||||
</required>
|
||||
-->
|
||||
<thelia>2.3.0</thelia>
|
||||
<stability>other</stability>
|
||||
</module>
|
||||
35
local/modules/PaymentCondition/Config/routing.xml
Normal file
35
local/modules/PaymentCondition/Config/routing.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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="payment_condition_configuration_view" path="/admin/module/PaymentCondition">
|
||||
<default key="_controller">PaymentCondition\Controller\AdminController::viewAction</default>
|
||||
</route>
|
||||
|
||||
<route id="payment_delivery_condition_view" path="/admin/module/paymentcondition/delivery" methods="get">
|
||||
<default key="_controller">PaymentCondition\Controller\DeliveryConditionController::viewAction</default>
|
||||
</route>
|
||||
|
||||
<route id="payment_delivery_condition_save" path="/admin/module/paymentcondition/delivery" methods="post">
|
||||
<default key="_controller">PaymentCondition\Controller\DeliveryConditionController::saveAction</default>
|
||||
</route>
|
||||
|
||||
<route id="payment_customer_family_condition_view" path="/admin/module/paymentcondition/customerfamily" methods="get">
|
||||
<default key="_controller">PaymentCondition\Controller\CustomerFamilyConditionController::viewAction</default>
|
||||
</route>
|
||||
|
||||
<route id="payment_customer_family_condition_save" path="/admin/module/paymentcondition/customerfamily" methods="post">
|
||||
<default key="_controller">PaymentCondition\Controller\CustomerFamilyConditionController::saveAction</default>
|
||||
</route>
|
||||
|
||||
<route id="payment_area_condition_view" path="/admin/module/paymentcondition/area" methods="get">
|
||||
<default key="_controller">PaymentCondition\Controller\AreaConditionController::viewAction</default>
|
||||
</route>
|
||||
|
||||
<route id="payment_area_condition_save" path="/admin/module/paymentcondition/area" methods="post">
|
||||
<default key="_controller">PaymentCondition\Controller\AreaConditionController::saveAction</default>
|
||||
</route>
|
||||
|
||||
</routes>
|
||||
71
local/modules/PaymentCondition/Config/schema.xml
Normal file
71
local/modules/PaymentCondition/Config/schema.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?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="payment_delivery_condition" namespace="PaymentCondition\Model">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="payment_module_id" type="INTEGER" required="true"/>
|
||||
<column name="delivery_module_id" type="INTEGER" required="true"/>
|
||||
<column name="is_valid" type="TINYINT"/>
|
||||
|
||||
<foreign-key foreignTable="module" name="fk_payment_delivery_condition_payment_module_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="payment_module_id" />
|
||||
</foreign-key>
|
||||
|
||||
<foreign-key foreignTable="module" name="fk_payment_delivery_condition_delivery_module_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="delivery_module_id" />
|
||||
</foreign-key>
|
||||
</table>
|
||||
|
||||
<table name="payment_customer_family_condition" namespace="PaymentCondition\Model">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="payment_module_id" type="INTEGER" required="true"/>
|
||||
<column name="customer_family_id" type="INTEGER" required="true"/>
|
||||
<column name="is_valid" type="TINYINT"/>
|
||||
|
||||
<foreign-key foreignTable="module" name="fk_payment_customer_family_condition_payment_module_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="payment_module_id" />
|
||||
</foreign-key>
|
||||
</table>
|
||||
|
||||
<table name="payment_area_condition" namespace="PaymentCondition\Model">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="payment_module_id" type="INTEGER" required="true"/>
|
||||
<column name="area_id" type="INTEGER" required="true"/>
|
||||
<column name="is_valid" type="TINYINT"/>
|
||||
|
||||
<foreign-key foreignTable="module" name="fk_payment_area_condition_payment_module_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="payment_module_id" />
|
||||
</foreign-key>
|
||||
|
||||
<foreign-key foreignTable="area" name="fk_payment_area_condition_area_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="area_id" />
|
||||
</foreign-key>
|
||||
</table>
|
||||
|
||||
<table name="payment_customer_condition" namespace="PaymentCondition\Model">
|
||||
<column name="customer_id" primaryKey="true" type="INTEGER" required="true"/>
|
||||
<column name="module_restriction_active" type="TINYINT"/>
|
||||
|
||||
<foreign-key foreignTable="customer" name="fk_payment_customer_condition_customer_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="customer_id" />
|
||||
</foreign-key>
|
||||
</table>
|
||||
|
||||
<table name="payment_customer_module_condition" namespace="PaymentCondition\Model">
|
||||
<column name="payment_module_id" primaryKey="true" type="INTEGER" required="true"/>
|
||||
<column name="customer_id" primaryKey="true" type="INTEGER" required="true"/>
|
||||
<column name="is_valid" type="TINYINT"/>
|
||||
|
||||
<foreign-key foreignTable="customer" name="fk_payment_customer_module_condition_customer_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="customer_id" />
|
||||
</foreign-key>
|
||||
|
||||
<foreign-key foreignTable="module" name="fk_payment_customer_module_condition_payment_module_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="payment_module_id" />
|
||||
</foreign-key>
|
||||
</table>
|
||||
|
||||
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
|
||||
</database>
|
||||
2
local/modules/PaymentCondition/Config/sqldb.map
Normal file
2
local/modules/PaymentCondition/Config/sqldb.map
Normal file
@@ -0,0 +1,2 @@
|
||||
# Sqlfile -> Database map
|
||||
thelia.sql=thelia
|
||||
125
local/modules/PaymentCondition/Config/thelia.sql
Normal file
125
local/modules/PaymentCondition/Config/thelia.sql
Normal file
@@ -0,0 +1,125 @@
|
||||
|
||||
# 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;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- payment_delivery_condition
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `payment_delivery_condition`;
|
||||
|
||||
CREATE TABLE `payment_delivery_condition`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`payment_module_id` INTEGER NOT NULL,
|
||||
`delivery_module_id` INTEGER NOT NULL,
|
||||
`is_valid` TINYINT,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_payment_delivery_condition_payment_module_id` (`payment_module_id`),
|
||||
INDEX `fi_payment_delivery_condition_delivery_module_id` (`delivery_module_id`),
|
||||
CONSTRAINT `fk_payment_delivery_condition_payment_module_id`
|
||||
FOREIGN KEY (`payment_module_id`)
|
||||
REFERENCES `module` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_payment_delivery_condition_delivery_module_id`
|
||||
FOREIGN KEY (`delivery_module_id`)
|
||||
REFERENCES `module` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- payment_customer_family_condition
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `payment_customer_family_condition`;
|
||||
|
||||
CREATE TABLE `payment_customer_family_condition`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`payment_module_id` INTEGER NOT NULL,
|
||||
`customer_family_id` INTEGER NOT NULL,
|
||||
`is_valid` TINYINT,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_payment_customer_family_condition_payment_module_id` (`payment_module_id`),
|
||||
CONSTRAINT `fk_payment_customer_family_condition_payment_module_id`
|
||||
FOREIGN KEY (`payment_module_id`)
|
||||
REFERENCES `module` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- payment_area_condition
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `payment_area_condition`;
|
||||
|
||||
CREATE TABLE `payment_area_condition`
|
||||
(
|
||||
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||
`payment_module_id` INTEGER NOT NULL,
|
||||
`area_id` INTEGER NOT NULL,
|
||||
`is_valid` TINYINT,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `fi_payment_area_condition_payment_module_id` (`payment_module_id`),
|
||||
INDEX `fi_payment_area_condition_area_id` (`area_id`),
|
||||
CONSTRAINT `fk_payment_area_condition_payment_module_id`
|
||||
FOREIGN KEY (`payment_module_id`)
|
||||
REFERENCES `module` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_payment_area_condition_area_id`
|
||||
FOREIGN KEY (`area_id`)
|
||||
REFERENCES `area` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- payment_customer_condition
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `payment_customer_condition`;
|
||||
|
||||
CREATE TABLE `payment_customer_condition`
|
||||
(
|
||||
`customer_id` INTEGER NOT NULL,
|
||||
`module_restriction_active` TINYINT,
|
||||
PRIMARY KEY (`customer_id`),
|
||||
CONSTRAINT `fk_payment_customer_condition_customer_id`
|
||||
FOREIGN KEY (`customer_id`)
|
||||
REFERENCES `customer` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- payment_customer_module_condition
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `payment_customer_module_condition`;
|
||||
|
||||
CREATE TABLE `payment_customer_module_condition`
|
||||
(
|
||||
`payment_module_id` INTEGER NOT NULL,
|
||||
`customer_id` INTEGER NOT NULL,
|
||||
`is_valid` TINYINT,
|
||||
PRIMARY KEY (`payment_module_id`,`customer_id`),
|
||||
INDEX `fi_payment_customer_module_condition_customer_id` (`customer_id`),
|
||||
CONSTRAINT `fk_payment_customer_module_condition_customer_id`
|
||||
FOREIGN KEY (`customer_id`)
|
||||
REFERENCES `customer` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE,
|
||||
CONSTRAINT `fk_payment_customer_module_condition_payment_module_id`
|
||||
FOREIGN KEY (`payment_module_id`)
|
||||
REFERENCES `module` (`id`)
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user