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

@@ -21,7 +21,6 @@
<hooks>
<hook id="lps.admin.hook" class="LivraisonParSecteurs\Hook\AdminHook">
<tag name="hook.event_listener" event="main.in-top-menu-items" type="back" method="onMainTopMenuTools" />
<!-- <tag name="hook.event_listener" event="module.configuration" type="back" method="onModuleConfig" />-->
<tag name="hook.event_listener" event="order-edit.bill-delivery-address" type="back" method="displayDeliveryDate" />
<tag name="hook.event_listener" event="home.block" type="back" method="displayScheduledDeliveries" />
<argument type="service" id="thelia.securityContext"/>

View File

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

View File

@@ -0,0 +1,72 @@
# 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;
-- ---------------------------------------------------------------------
-- lps_area
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `lps_area`;
CREATE TABLE `lps_area`
(
`id` INTEGER NOT NULL,
`title` VARCHAR(50) NOT NULL,
`active` TINYINT DEFAULT 1 NOT NULL,
`price` FLOAT DEFAULT 0 NOT NULL,
`minimum_amount` FLOAT DEFAULT 15 NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- lps_area_city
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `lps_area_city`;
CREATE TABLE `lps_area_city`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`id_area` INTEGER NOT NULL,
`zipcode` VARCHAR(10) NOT NULL,
`title` VARCHAR(50) NOT NULL,
`latitude` DOUBLE,
`longitude` DOUBLE,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
INDEX `fi_area_area_city` (`id_area`),
CONSTRAINT `fk_area_area_city`
FOREIGN KEY (`id_area`)
REFERENCES `lps_area` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB;
-- ---------------------------------------------------------------------
-- lps_area_schedule
-- ---------------------------------------------------------------------
DROP TABLE IF EXISTS `lps_area_schedule`;
CREATE TABLE `lps_area_schedule`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`id_area` INTEGER NOT NULL,
`day` INTEGER NOT NULL,
`begin_time` TIME NOT NULL,
`end_time` TIME NOT NULL,
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
INDEX `fi_area_area_schedule` (`id_area`),
CONSTRAINT `fk_area_area_schedule`
FOREIGN KEY (`id_area`)
REFERENCES `lps_area` (`id`)
ON DELETE CASCADE
) ENGINE=InnoDB;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -26,6 +26,15 @@ class GeneralForm extends BaseForm
"required" => true,
"constraints" => [new Constraints\NotBlank()]
])
->add(
"title",
"text",
[
"required" => true,
"constraints" => [new Constraints\NotBlank(), new Constraints\NotNull()],
"label" => $this->translator->trans('Area name', [], LivraisonParSecteurs::DOMAIN_NAME),
"label_attr" => ['for' => 'title']
])
->add(
"price",
"number",

View File

@@ -87,7 +87,7 @@ class AdminHook extends BaseHook
"id" => "block-scheduled-deliveries",
"title" => $this->trans("Scheduled deliveries", [], LivraisonParSecteurs::DOMAIN_NAME),
"content" => $content,
"class" => "col-md-8"
"class" => "col-md-6"
]);
}
}

View File

@@ -26,7 +26,7 @@ return array(
'General' => 'Général',
'Home delivery cost' => 'Frais de livraison à domicile',
'Message info minimum de commande' => 'Un panier d\'un montant minimum de %montant € est nécessaire pour pouvoir bénéficier de la livraison à domicile.',
'Minimum amount' => 'Montant minimum de commande',
'Minimum amount' => 'Minimum de commande',
'Modify a delivery day' => 'Modifier un jour de livraison',
'Module name' => 'Livraison à domicile',
'My areas' => 'Mes secteurs de livraison',
@@ -42,12 +42,12 @@ return array(
'There is no order to deliver' => 'Aucune commande à livrer à domicile',
'There is no schedule for this area' => 'Aucune livraison actuellement sur ce secteur',
'Title of config view' => 'Livraison à domicile - Configuration',
'Zipcode' => 'Code postal',
'Monday' => 'Lundi',
'Zipcode' => 'Code postal', 'Monday' => 'Lundi',
'Tuesday' => 'Mardi',
'Wednesday' => 'Mercredi',
'Thursday' => 'Jeudi',
'Friday' => 'Vendredi',
'Saturday' => 'Samedi',
'Sunday' => 'Dimanche',
);

View File

@@ -7,7 +7,6 @@ use LivraisonParSecteurs\Model\LpsAreaCityQuery;
use LivraisonParSecteurs\Model\LpsAreaQuery;
use Propel\Runtime\Connection\ConnectionInterface;
use Propel\Runtime\Propel;
use Symfony\Component\Form\FormError;
use Thelia\Core\Translation\Translator;
use Thelia\Install\Database;
use Thelia\Model\AddressQuery;
@@ -82,7 +81,6 @@ class LivraisonParSecteurs extends AbstractDeliveryModule
}
}
}
$isValid = true;
return $isValid;
}

View File

@@ -1,4 +1,4 @@
{extends file="admin-layout.tpl"}
mais{extends file="admin-layout.tpl"}
{block name="no-return-functions"}
{$admin_current_location = 'module'}

View File

@@ -1,4 +1,10 @@
{form name='lps-area-general-update'}
<style>
.etroit { width: 80px !important; }
.large { width: 250px !important; }
</style>
<div class="form-container">
{if $form_error}
@@ -24,6 +30,18 @@
<div class="row form-inline">
<div class="col-md-3">
{form_field form=$form field="title"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
{intl l=$label d='livraisonparsecteurs'}
</label>
<input type="text" id="{$label_attr.for}" class="form-control large" name="{$name}" value="{$TITLE}" {if $required}required{/if} />&nbsp
</div>
{form_error form=$form field="title"}{$message}{/form_error}
{/form_field}
</div>
<div class="col-md-2">
{form_field form=$form field="active"}
<div class="form-group">
<label class="control-label" for="{$label_attr.for}">
@@ -40,7 +58,7 @@
{/form_field}
</div>
<div class="col-md-3">
<div class="col-md-2">
{form_field form=$form field="price"}
<div class="form-group form-inline">
<label class="control-label" for="{$label_attr.for}">
@@ -48,7 +66,7 @@
{if $required}<span class="required">*</span>{/if}
</label>
<input type="text" id="{$label_attr.for}" class="form-control" name="{$name}" value="{$PRICE}" {if $required}required{/if} />&nbsp;
<input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" value="{$PRICE}" {if $required}required{/if} />&nbsp;
</div>
{form_error form=$form field="price"}{$message}{/form_error}
{/form_field}
@@ -62,14 +80,12 @@
{if $required}<span class="required">*</span>{/if}
</label>
<input type="text" id="{$label_attr.for}" class="form-control" name="{$name}" value="{$MINIMUM_AMOUNT}" {if $required}required{/if} />&nbsp;
<input type="text" id="{$label_attr.for}" class="form-control etroit" name="{$name}" value="{$MINIMUM_AMOUNT}" {if $required}required{/if} />&nbsp;
</div>
{form_error form=$form field="minimum_amount"}{$message}{/form_error}
{/form_field}
</div>
<div class="col-md-2">&nbsp;</div>
</div>
</form>
{/loop}

View File

@@ -16,7 +16,6 @@
</style>
{loop type="auth" name="can_view" role="ADMIN" module="HookAdminHome" access="VIEW"}
<div class="scheduled-deliveries-list">
<table class="table table-striped">
<thead>
@@ -28,7 +27,7 @@
<th>{intl l="Area" d="livraisonparsecteurs"}</th>
</thead>
<tbody>
{loop name="deliveries-loop" type="scheduled_deliveries" order="date"}
{loop name="deliveries-loop" type="scheduled_deliveries" domicile_ou_retrait="domicile" only_future="true" order="date"}
{if $DELTA <= 7}
{assign var=path value="{image file='/assets/img/flag-green.png'}"}
{assign var=alt value='Drapeau vert'}
@@ -84,4 +83,3 @@
<span class="nb-commandes">Total :&nbsp;&nbsp;<b>{$nbCommandes}</b>&nbsp;&nbsp;commande(s)</span>
</div>
{/loop}