Premiers écrans sur module PointRetrait

This commit is contained in:
2021-02-26 21:10:10 +01:00
parent 86d849a059
commit 1276d9bf3d
34 changed files with 1200 additions and 100 deletions

View File

@@ -4,31 +4,21 @@
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">
<hooks>
<hook id="pdr.admin.hook" class="PointRetrait\Hook\AdminHook">
<tag name="hook.event_listener" event="home.block" type="back" method="displayScheduledWithdrawals" />
<tag name="hook.event_listener" event="main.in-top-menu-items" type="back" method="onMainTopMenuTools" />
<argument type="service" id="thelia.securityContext"/>
</hook>
</hooks>
<loops>
<!-- sample definition
<loop name="MySuperLoop" class="PointRetrait\Loop\MySuperLoop" />
-->
<loop name="pdr_places" class="PointRetrait\Loop\GeneralLoop"/>
<loop name="pdr_schedule" class="PointRetrait\Loop\ScheduleLoop"/>
</loops>
<forms>
<!--
<form name="MyFormName" class="PointRetrait\Form\MySuperForm" />
-->
<form name="pdr-place-main-update" class="PointRetrait\Form\MainForm"/>
</forms>
<!--
<services>
</services>
-->
<!--
<hooks>
<hook id="pointretrait.hook" class="PointRetrait\Hook\MySuperHook">
<tag name="hook.event_listener" event="main.body.bottom" type="front|back|pdf|email" method="onMainBodyBottom" />
</hook>
</hooks>
-->
</config>

View File

@@ -4,28 +4,17 @@
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">
<!--
if a /admin/module/pointretrait/ route is provided, a "Configuration" button will be displayed
for the module in the module list. Clicking this button will invoke this route.
<route id="my_route_id" path="/admin/module/pointretrait">
<default key="_controller">PointRetrait\Full\Class\Name\Of\YourConfigurationController::methodName</default>
<route id="pointretrait.places.list" path="/admin/module/PointRetrait">
<default key="_controller">PointRetrait\Controller\backOffice\ListController::viewAction</default>
</route>
<route id="pointretrait.toggle.active" path="/admin/module/PointRetrait/toggle-online/{id}" methods="post">
<default key="_controller">PointRetrait\Controller\backOffice\ListController::toggleActive</default>
<requirement key="id">\d+</requirement>
</route>
<route id="my_route_id" path="/admin/module/pointretrait/route-name">
<default key="_controller">PointRetrait\Full\Class\Name\Of\YourAdminController::methodName</default>
<route id="pointretrait.place.view" path="/admin/module/PointRetrait/edit" methods="get">
<default key="_controller">PointRetrait\Controller\backOffice\PlaceController::viewPlace</default>
</route>
<route id="my_route_id" path="/my/route/name">
<default key="_controller">PointRetrait\Full\Class\Name\Of\YourOtherController::methodName</default>
</route>
...add as many routes as required.
<route>
...
</route>
-->
</routes>

View File

@@ -2,24 +2,34 @@
<database defaultIdMethod="native" name="thelia"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../core/vendor/thelia/propel/resources/xsd/database.xsd" >
<!--
See propel documentation on http://propelorm.org for all information about schema file
<table name="product_rel" namespace="PointRetrait\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column defaultValue="0" name="visible" required="true" type="TINYINT" />
<column defaultValue="0" name="position" required="true" type="INTEGER" />
<column name="title" size="255" type="VARCHAR" />
<column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" />
<foreign-key foreignTable="product" name="fk_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="product_id" />
</foreign-key>
<behavior name="timestampable" />
<behavior name="i18n">
<parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
</behavior>
<table name="pdr_places" namespace="PointRetrait\Model">
<column name="id" autoIncrement="true" primaryKey="true" required="true" type="INTEGER" />
<column name="title" required="true" size="50" type="VARCHAR" />
<column name="active" required="true" type="TINYINT" defaultValue="1" />
<column name="price" required="true" type="FLOAT" defaultValue="0" />
<column name="minimum_amount" required="true" type="FLOAT" defaultValue="0" />
<column name="latitude" required="false" type="DOUBLE" />
<column name="longitude" required="false" type="DOUBLE" />
<column name="address1" size="255" type="VARCHAR" required="true"/>
<column name="address2" size="255" type="VARCHAR"/>
<column name="address3" size="255" type="VARCHAR"/>
<column name="zipcode" required="true" size="10" type="VARCHAR"/>
<column name="city" required="true" size="255" type="VARCHAR"/>
</table>
-->
<table name="pdr_schedule" namespace="PointRetrait\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="id_place" required="true" type="INTEGER" />
<column name="day" required="true" type="INTEGER" />
<column name="begin_time" required="true" type="TIME" />
<column name="end_time" required="true" type="TIME" />
<foreign-key foreignTable="pdr_places" name="fk_places_schedule" onDelete="CASCADE">
<reference foreign="id" local="id_place"/>
</foreign-key>
</table>
</database>

View File

@@ -0,0 +1,2 @@
# Sqlfile -> Database map
thelia.sql=thelia

View File

@@ -0,0 +1,51 @@
# 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;
-- ---------------------------------------------------------------------
-- pdr_places
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `pdr_places`;
CREATE TABLE `pdr_places`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`title` VARCHAR(50) NOT NULL,
`active` TINYINT DEFAULT 1 NOT NULL,
`price` FLOAT DEFAULT 0 NOT NULL,
`minimum_amount` FLOAT DEFAULT 0 NOT NULL,
`latitude` DOUBLE,
`longitude` DOUBLE,
`address1` VARCHAR(255) NOT NULL,
`address2` VARCHAR(255),
`address3` VARCHAR(255),
`zipcode` VARCHAR(10) NOT NULL,
`city` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- pdr_schedule
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `pdr_schedule`;
CREATE TABLE `pdr_schedule`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`id_place` INTEGER NOT NULL,
`day` INTEGER NOT NULL,
`begin_time` TIME NOT NULL,
`end_time` TIME NOT NULL,
PRIMARY KEY (`id`),
INDEX `fi_places_schedule` (`id_place`),
CONSTRAINT `fk_places_schedule`
FOREIGN KEY (`id_place`)
REFERENCES `pdr_places` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;