From 275b20ac7751e2330fc0816e45d51453a01a49b6 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 13 Sep 2013 10:17:45 +0200 Subject: [PATCH 1/7] allow to make an address as default on update action --- core/lib/Thelia/Action/Address.php | 4 ++++ .../Thelia/Config/Resources/routing/front.xml | 7 ++++++- .../Controller/Front/AddressController.php | 18 +++++++----------- .../Controller/Front/BaseFrontController.php | 7 +++++++ .../Core/Event/AddressCreateOrUpdateEvent.php | 18 +++++++++++++++++- core/lib/Thelia/Form/AddressCreateForm.php | 10 ++++++++-- core/lib/Thelia/Model/Address.php | 14 ++++++++++++++ templates/default/account.html | 3 ++- templates/default/register.html | 4 ++-- 9 files changed, 67 insertions(+), 18 deletions(-) diff --git a/core/lib/Thelia/Action/Address.php b/core/lib/Thelia/Action/Address.php index 278f71a5b..27d46a4b7 100644 --- a/core/lib/Thelia/Action/Address.php +++ b/core/lib/Thelia/Action/Address.php @@ -73,6 +73,10 @@ class Address extends BaseAction implements EventSubscriberInterface ->save() ; + if($event->getIsDefault()) { + $addressModel->makeItDefault(); + } + $event->setAddress($addressModel); } diff --git a/core/lib/Thelia/Config/Resources/routing/front.xml b/core/lib/Thelia/Config/Resources/routing/front.xml index c50fd97b9..c30e576b9 100755 --- a/core/lib/Thelia/Config/Resources/routing/front.xml +++ b/core/lib/Thelia/Config/Resources/routing/front.xml @@ -59,7 +59,12 @@ - + + Thelia\Controller\Front\DefaultController::noAction + address + + + Thelia\Controller\Front\AddressController::createAction address diff --git a/core/lib/Thelia/Controller/Front/AddressController.php b/core/lib/Thelia/Controller/Front/AddressController.php index 5f3fb4799..c4a40d951 100644 --- a/core/lib/Thelia/Controller/Front/AddressController.php +++ b/core/lib/Thelia/Controller/Front/AddressController.php @@ -46,14 +46,13 @@ class AddressController extends BaseFrontController */ public function generateModalAction($address_id) { - if ($this->getSecurityContext()->hasCustomerUser() === false) { - $this->accessDenied(); - } - + $this->checkAuth(); $this->checkXmlHttpRequest(); } + + /** * Create controller. * Check if customer is logged in @@ -62,9 +61,7 @@ class AddressController extends BaseFrontController */ public function createAction() { - if ($this->getSecurityContext()->hasCustomerUser() === false) { - $this->accessDenied() - } + $this->checkAuth(); $addressCreate = new AddressCreateForm($this->getRequest()); @@ -98,11 +95,9 @@ class AddressController extends BaseFrontController public function updateAction() { + $this->checkAuth(); $request = $this->getRequest(); - if ($this->getSecurityContext()->hasCustomerUser() === false) { - $this->redirectToRoute("home"); - } if (null === $address_id = $request->get("address_id")) { $this->redirectToRoute("home"); @@ -164,7 +159,8 @@ class AddressController extends BaseFrontController $form->get("country")->getData(), $form->get("cellphone")->getData(), $form->get("phone")->getData(), - $form->get("company")->getData() + $form->get("company")->getData(), + $form->get("is_default")->getData() ); } } diff --git a/core/lib/Thelia/Controller/Front/BaseFrontController.php b/core/lib/Thelia/Controller/Front/BaseFrontController.php index cf83e865d..1c4a13977 100755 --- a/core/lib/Thelia/Controller/Front/BaseFrontController.php +++ b/core/lib/Thelia/Controller/Front/BaseFrontController.php @@ -50,4 +50,11 @@ class BaseFrontController extends BaseController { $this->redirect(URL::getInstance()->absoluteUrl($this->getRoute($routeId, array(), $referenceType), $urlParameters)); } + + public function checkAuth() + { + if($this->getSecurityContext()->hasCustomerUser() === false) { + $this->redirectToRoute("customer.login.view"); + } + } } diff --git a/core/lib/Thelia/Core/Event/AddressCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/AddressCreateOrUpdateEvent.php index af69ae0b4..01e615ff6 100644 --- a/core/lib/Thelia/Core/Event/AddressCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/AddressCreateOrUpdateEvent.php @@ -108,7 +108,12 @@ class AddressCreateOrUpdateEvent extends ActionEvent */ protected $address; - public function __construct($label, $title, $firstname, $lastname, $address1, $address2, $address3, $zipcode, $city, $country, $cellphone, $phone, $company) + /** + * @var int + */ + protected $isDefault; + + public function __construct($label, $title, $firstname, $lastname, $address1, $address2, $address3, $zipcode, $city, $country, $cellphone, $phone, $company, $isDefault = 0) { $this->address1 = $address1; $this->address2 = $address2; @@ -123,6 +128,7 @@ class AddressCreateOrUpdateEvent extends ActionEvent $this->phone = $phone; $this->title = $title; $this->zipcode = $zipcode; + $this->isDefault = $isDefault; } /** @@ -229,6 +235,16 @@ class AddressCreateOrUpdateEvent extends ActionEvent return $this->zipcode; } + /** + * @return int + */ + public function getIsDefault() + { + return $this->isDefault; + } + + + /** * @param \Thelia\Model\Customer $customer */ diff --git a/core/lib/Thelia/Form/AddressCreateForm.php b/core/lib/Thelia/Form/AddressCreateForm.php index ed1750047..483366a1f 100644 --- a/core/lib/Thelia/Form/AddressCreateForm.php +++ b/core/lib/Thelia/Form/AddressCreateForm.php @@ -60,7 +60,7 @@ class AddressCreateForm extends BaseForm "constraints" => array( new NotBlank() ), - "label" => Translator::getInstance()->trans("Address label *"), + "label" => Translator::getInstance()->trans("Address label"), "label_attr" => array( "for" => "label_create" ), @@ -154,11 +154,17 @@ class AddressCreateForm extends BaseForm ) )) ->add("company", "text", array( - "label" => Translator::getInstance()->trans("Compagny"), + "label" => Translator::getInstance()->trans("Company"), "label_attr" => array( "for" => "company_create" ) )) + ->add("is_default", "integer", array( + "label" => Translator::getInstance()->trans("Make this address has my primary address"), + "label_attr" => array( + "for" => "default_address" + ) + )) ; } diff --git a/core/lib/Thelia/Model/Address.php b/core/lib/Thelia/Model/Address.php index dbd334ba2..9c2a390b5 100755 --- a/core/lib/Thelia/Model/Address.php +++ b/core/lib/Thelia/Model/Address.php @@ -7,10 +7,24 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Thelia\Core\Event\AddressEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Model\Base\Address as BaseAddress; +use Thelia\Model\AddressQuery; class Address extends BaseAddress { use \Thelia\Model\Tools\ModelEventDispatcherTrait; + /** + * put the the current address as default one + */ + public function makeItDefault() + { + + AddressQuery::create()->filterByCustomerId($this->getCustomerId()) + ->update(array('isDefault' => '0')); + + $this->setIsDefault(1); + $this->save(); + } + /** * Code to be run before inserting to database * @param ConnectionInterface $con diff --git a/templates/default/account.html b/templates/default/account.html index c7edeb449..b67d6424c 100644 --- a/templates/default/account.html +++ b/templates/default/account.html @@ -1,3 +1,4 @@ +{check_auth context="front" roles="CUSTOMER" login_tpl="login"} {extends file="layout.tpl"} {block name="breadcrumb"} @@ -74,7 +75,7 @@
- {intl l="Add a new address"} + {intl l="Add a new address"} {loop type="address" name="customer.addresses"} diff --git a/templates/default/register.html b/templates/default/register.html index 7100737bc..a3448932b 100644 --- a/templates/default/register.html +++ b/templates/default/register.html @@ -96,7 +96,7 @@
- + {if $error } {$message} {elseif $value != "" && !$error} @@ -109,7 +109,7 @@
- + {if $error } {$message} {elseif $value != "" && !$error} From 2d8656e45b0dea6aa8254285e8d601faa1556f16 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 13 Sep 2013 10:55:45 +0200 Subject: [PATCH 2/7] allow to create a new address --- core/lib/Thelia/Action/Address.php | 58 ++++--- core/lib/Thelia/Model/Address.php | 2 +- templates/default/address.html | 247 +++++++++++++++++++++++++++++ 3 files changed, 283 insertions(+), 24 deletions(-) create mode 100644 templates/default/address.html diff --git a/core/lib/Thelia/Action/Address.php b/core/lib/Thelia/Action/Address.php index 27d46a4b7..0aee9a6f5 100644 --- a/core/lib/Thelia/Action/Address.php +++ b/core/lib/Thelia/Action/Address.php @@ -22,10 +22,13 @@ /*************************************************************************************/ namespace Thelia\Action; +use Propel\Runtime\Exception\PropelException; +use Propel\Runtime\Propel; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Thelia\Core\Event\AddressCreateOrUpdateEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Model\Address as AddressModel; +use Thelia\Model\Map\AddressTableMap; /** * Class Address @@ -52,32 +55,41 @@ class Address extends BaseAction implements EventSubscriberInterface protected function createOrUpdate(AddressModel $addressModel, AddressCreateOrUpdateEvent $event) { $addressModel->setDispatcher($this->getDispatcher()); + $con = Propel::getWriteConnection(AddressTableMap::DATABASE_NAME); + $con->beginTransaction(); + try { + if ($addressModel->isNew()) { + $addressModel->setLabel($event->getLabel()); + } - if ($addressModel->isNew()) { - $addressModel->setLabel($event->getLabel()); + $addressModel + ->setTitleId($event->getTitle()) + ->setFirstname($event->getFirstname()) + ->setLastname($event->getLastname()) + ->setAddress1($event->getAddress1()) + ->setAddress2($event->getAddress2()) + ->setAddress3($event->getAddress3()) + ->setZipcode($event->getZipcode()) + ->setCity($event->getCity()) + ->setCountryId($event->getCountry()) + ->setCellphone($event->getCellphone()) + ->setPhone($event->getPhone()) + ->setCompany($event->getCompany()) + ->save() + ; + + if($event->getIsDefault()) { + $addressModel->makeItDefault(); + } + + $event->setAddress($addressModel); + $con->commit(); + + } catch(PropelException $e) { + $con->rollback(); + throw $e; } - $addressModel - ->setTitleId($event->getTitle()) - ->setFirstname($event->getFirstname()) - ->setLastname($event->getLastname()) - ->setAddress1($event->getAddress1()) - ->setAddress2($event->getAddress2()) - ->setAddress3($event->getAddress3()) - ->setZipcode($event->getZipcode()) - ->setCity($event->getCity()) - ->setCountryId($event->getCountry()) - ->setCellphone($event->getCellphone()) - ->setPhone($event->getPhone()) - ->setCompany($event->getCompany()) - ->save() - ; - - if($event->getIsDefault()) { - $addressModel->makeItDefault(); - } - - $event->setAddress($addressModel); } /** diff --git a/core/lib/Thelia/Model/Address.php b/core/lib/Thelia/Model/Address.php index 9c2a390b5..8c9bd4552 100755 --- a/core/lib/Thelia/Model/Address.php +++ b/core/lib/Thelia/Model/Address.php @@ -19,7 +19,7 @@ class Address extends BaseAddress { { AddressQuery::create()->filterByCustomerId($this->getCustomerId()) - ->update(array('isDefault' => '0')); + ->update(array('IsDefault' => '0')); $this->setIsDefault(1); $this->save(); diff --git a/templates/default/address.html b/templates/default/address.html new file mode 100644 index 000000000..086a2b5ba --- /dev/null +++ b/templates/default/address.html @@ -0,0 +1,247 @@ +{check_auth context="front" roles="CUSTOMER" login_tpl="login"} +{extends file="layout.tpl"} + +{block name="breadcrumb"} + +{/block} + +{block name="main-content"} +
+ +
+ +

{intl l="Create New Address"}

+ {form name="thelia.address.create"} +
+ {form_field form=$form field='success_url'} + {* the url the user is redirected to on login success *} + {/form_field} + + {form_field form=$form field='error_message'} + {* the url the user is redirected to on login success *} + {/form_field} + {form_hidden_fields form=$form} + {if $form_error}
{$form_error_message}
{/if} +
+
+ {intl l="Address"} +
+ +
+ {form_field form=$form field="label"} +
+ + +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ + {/form_field} + + {form_field form=$form field="title"} +
+ +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ {/form_field} + + {form_field form=$form field="firstname"} +
+ + +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ + {/form_field} + + + {form_field form=$form field="lastname"} +
+ + +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ + {/form_field} + + {form_field form=$form field="address1"} +
+ + +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ + {/form_field} + + {form_field form=$form field="address2"} +
+ + +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ + {/form_field} + + {form_field form=$form field="zipcode"} +
+ + +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ + {/form_field} + + {form_field form=$form field="city"} +
+ + +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ + {/form_field} + + {form_field form=$form field="country"} +
+ +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ {/form_field} + + {form_field form=$form field="phone"} +
+ + +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ + {/form_field} + + {form_field form=$form field="cellphone"} +
+ + +
+ + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
+
+ + {/form_field} +
+
+ + {form_field form=$form field="is_default"} +
+
+
+ +
+
+
+ + {/form_field} + +
+
+ +
+
+ + + {/form} +
+ +
+{/block} \ No newline at end of file From ddf175f361542c335ed84b109c1445403a099771 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 13 Sep 2013 11:31:12 +0200 Subject: [PATCH 3/7] allow update customer address in front tempalte --- .../Thelia/Config/Resources/routing/front.xml | 11 +- .../Controller/Front/AddressController.php | 26 +- templates/default/account.html | 2 +- templates/default/address-update.html | 250 ++++++++++++++++++ templates/default/address.html | 4 +- 5 files changed, 277 insertions(+), 16 deletions(-) create mode 100644 templates/default/address-update.html diff --git a/core/lib/Thelia/Config/Resources/routing/front.xml b/core/lib/Thelia/Config/Resources/routing/front.xml index c30e576b9..da3c1bdb7 100755 --- a/core/lib/Thelia/Config/Resources/routing/front.xml +++ b/core/lib/Thelia/Config/Resources/routing/front.xml @@ -69,13 +69,14 @@ address - - Thelia\Controller\Front\DefaultController::noAction - address-edit + + Thelia\Controller\Front\AddressController::updateViewAction + address-update - - Thelia\Controller\Front\AddressController::updateAction + + Thelia\Controller\Front\AddressController::processUpdateAction + address-update diff --git a/core/lib/Thelia/Controller/Front/AddressController.php b/core/lib/Thelia/Controller/Front/AddressController.php index c4a40d951..33fa67069 100644 --- a/core/lib/Thelia/Controller/Front/AddressController.php +++ b/core/lib/Thelia/Controller/Front/AddressController.php @@ -27,7 +27,7 @@ use Thelia\Core\Event\TheliaEvents; use Thelia\Form\AddressCreateForm; use Thelia\Form\AddressUpdateForm; use Thelia\Form\Exception\FormValidationException; -use Thelia\Model\Base\AddressQuery; +use Thelia\Model\AddressQuery; use Thelia\Model\Customer; use Thelia\Tools\URL; @@ -93,18 +93,28 @@ class AddressController extends BaseFrontController } } - public function updateAction() + public function updateViewAction($address_id) + { + $this->checkAuth(); + + $customer = $this->getSecurityContext()->getCustomerUser(); + $address = AddressQuery::create()->findPk($address_id); + + if(!$address || $customer->getId() != $address->getCustomerId()) { + $this->redirectToRoute("home"); + } + + $this->getParserContext()->set("address_id", $address_id); + } + + public function processUpdateAction($address_id) { $this->checkAuth(); $request = $this->getRequest(); - - if (null === $address_id = $request->get("address_id")) { - $this->redirectToRoute("home"); - } - $addressUpdate = new AddressUpdateForm($request); + try { $customer = $this->getSecurityContext()->getCustomerUser(); @@ -131,7 +141,7 @@ class AddressController extends BaseFrontController } catch (\Exception $e) { $message = sprintf("Sorry, an error occured: %s", $e->getMessage()); } - + $this->getParserContext()->set("address_id", $address_id); if ($message !== false) { \Thelia\Log\Tlog::getInstance()->error(sprintf("Error during address creation process : %s", $message)); diff --git a/templates/default/account.html b/templates/default/account.html index b67d6424c..f3815e5c0 100644 --- a/templates/default/account.html +++ b/templates/default/account.html @@ -114,7 +114,7 @@
{/loop} + + + + + {/ifloop}
@@ -110,34 +142,6 @@ {module_include location='customer_bottom'} -
-
- -
    - {if $customer_page != 1} -
  • «
  • - {else} -
  • «
  • - {/if} - - {pageloop rel="customer_list"} - {if $PAGE != $CURRENT} -
  • {$PAGE}
  • - - {else} -
  • {$PAGE}
  • - {/if} - - {if $PAGE == $LAST && $LAST != $CURRENT} -
  • »
  • - {else} -
  • »
  • - {/if} - {/pageloop} -
- -
-
{* Adding a new Category *} From 8367863b489de325ec04794bd5aecf59b71e417e Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 13 Sep 2013 12:33:13 +0200 Subject: [PATCH 5/7] allow address removal from front --- core/lib/Thelia/Action/Address.php | 11 +++++- .../Thelia/Config/Resources/routing/front.xml | 5 +++ .../Controller/Front/AddressController.php | 17 ++++++++ core/lib/Thelia/Core/Event/TheliaEvents.php | 5 +++ templates/default/account.html | 39 +++++++++++++++++-- 5 files changed, 73 insertions(+), 4 deletions(-) diff --git a/core/lib/Thelia/Action/Address.php b/core/lib/Thelia/Action/Address.php index 0aee9a6f5..a912888c8 100644 --- a/core/lib/Thelia/Action/Address.php +++ b/core/lib/Thelia/Action/Address.php @@ -26,6 +26,7 @@ use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Propel; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Thelia\Core\Event\AddressCreateOrUpdateEvent; +use Thelia\Core\Event\AddressEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Model\Address as AddressModel; use Thelia\Model\Map\AddressTableMap; @@ -52,6 +53,13 @@ class Address extends BaseAction implements EventSubscriberInterface $this->createOrUpdate($addressModel, $event); } + public function delete(AddressEvent $event) + { + $address = $event->getAddress(); + + $address->delete(); + } + protected function createOrUpdate(AddressModel $addressModel, AddressCreateOrUpdateEvent $event) { $addressModel->setDispatcher($this->getDispatcher()); @@ -116,7 +124,8 @@ class Address extends BaseAction implements EventSubscriberInterface { return array( TheliaEvents::ADDRESS_CREATE => array("create", 128), - TheliaEvents::ADDRESS_UPDATE => array("update", 128) + TheliaEvents::ADDRESS_UPDATE => array("update", 128), + TheliaEvents::ADDRESS_DELETE => array("delete", 128) ); } } diff --git a/core/lib/Thelia/Config/Resources/routing/front.xml b/core/lib/Thelia/Config/Resources/routing/front.xml index da3c1bdb7..38afb7d7f 100755 --- a/core/lib/Thelia/Config/Resources/routing/front.xml +++ b/core/lib/Thelia/Config/Resources/routing/front.xml @@ -79,6 +79,11 @@ address-update + + Thelia\Controller\Front\AddressController::deleteAction + account + + Thelia\Controller\Front\AddressController::generateModalAction modal-address diff --git a/core/lib/Thelia/Controller/Front/AddressController.php b/core/lib/Thelia/Controller/Front/AddressController.php index 33fa67069..272fa6424 100644 --- a/core/lib/Thelia/Controller/Front/AddressController.php +++ b/core/lib/Thelia/Controller/Front/AddressController.php @@ -23,6 +23,7 @@ namespace Thelia\Controller\Front; use Thelia\Core\Event\AddressCreateOrUpdateEvent; +use Thelia\Core\Event\AddressEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Form\AddressCreateForm; use Thelia\Form\AddressUpdateForm; @@ -154,6 +155,22 @@ class AddressController extends BaseFrontController } } + public function deleteAction($address_id) + { + $this->checkAuth(); + + $customer = $this->getSecurityContext()->getCustomerUser(); + $address = AddressQuery::create()->findPk($address_id); + + if(!$address || $customer->getId() != $address->getCustomerId()) { + $this->redirectToRoute("home"); + } + + $this->dispatch(TheliaEvents::ADDRESS_DELETE, new AddressEvent($address)); + + $this->redirectToRoute("customer.account.view"); + } + protected function createAddressEvent($form) { return new AddressCreateOrUpdateEvent( diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index 97e140eb6..54f05c0c0 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -129,6 +129,11 @@ final class TheliaEvents */ const ADDRESS_UPDATE = "action.updateAddress"; + /** + * sent on address removal + */ + const ADDRESS_DELETE = "action.deleteAddress"; + const BEFORE_CREATEADDRESS = "action.before_createAddress"; const AFTER_CREATEADDRESS = "action.after_createAddress"; diff --git a/templates/default/account.html b/templates/default/account.html index f3815e5c0..94bd58501 100644 --- a/templates/default/account.html +++ b/templates/default/account.html @@ -78,8 +78,8 @@ {intl l="Add a new address"} - {loop type="address" name="customer.addresses"} - + {loop type="address" name="customer.addresses" customer="current"} + @@ -173,4 +173,37 @@ + + +{/block} + +{block name="after-javascript-include"} + + + {/block} \ No newline at end of file From ecc419fbdf53896c6ae8f40ce4710dbc0ac1ccaf Mon Sep 17 00:00:00 2001 From: Etienne Roudeix Date: Fri, 13 Sep 2013 13:59:16 +0200 Subject: [PATCH 6/7] tax engine retriever --- core/lib/Thelia/TaxEngine/Calculator.php | 75 ++++++++++++++++++- .../Thelia/TaxEngine/TaxType/BaseTaxType.php | 4 + .../TaxType/FeatureSlicePercentTaxType.php | 10 +++ .../TaxEngine/TaxType/FixAmountTaxType.php | 10 +++ .../TaxEngine/TaxType/PricePercentTaxType.php | 12 +++ .../Thelia/Tests/TaxEngine/CalculatorTest.php | 67 +++++++++++------ 6 files changed, 155 insertions(+), 23 deletions(-) diff --git a/core/lib/Thelia/TaxEngine/Calculator.php b/core/lib/Thelia/TaxEngine/Calculator.php index f8c527cd1..b5a2f995e 100755 --- a/core/lib/Thelia/TaxEngine/Calculator.php +++ b/core/lib/Thelia/TaxEngine/Calculator.php @@ -73,11 +73,16 @@ class Calculator return $this; } - public function getTaxAmount($untaxedPrice) + public function getTaxAmountFromUntaxedPrice($untaxedPrice) { return $this->getTaxedPrice($untaxedPrice) - $untaxedPrice; } + public function getTaxAmountFromTaxedPrice($taxedPrice) + { + return $taxedPrice - $this->getUntaxedPrice($taxedPrice); + } + public function getTaxedPrice($untaxedPrice) { if(null === $this->taxRulesCollection) { @@ -111,4 +116,72 @@ class Calculator return $taxedPrice; } + + public function getUntaxedPrice($taxedPrice) + { + if(null === $this->taxRulesCollection) { + throw new TaxEngineException('Tax rules collection is empty in Calculator::getTaxAmount', TaxEngineException::UNDEFINED_TAX_RULES_COLLECTION); + } + + if(false === filter_var($taxedPrice, FILTER_VALIDATE_FLOAT)) { + throw new TaxEngineException('BAD AMOUNT FORMAT', TaxEngineException::BAD_AMOUNT_FORMAT); + } + + $taxRule = $this->taxRulesCollection->getLast(); + + $untaxedPrice = $taxedPrice; + $currentPosition = (int)$taxRule->getTaxRuleCountryPosition(); + $currentFixTax = 0; + $currentTaxFactor = 0; + + do { + $position = (int)$taxRule->getTaxRuleCountryPosition(); + + $taxType = $taxRule->getTypeInstance(); + $taxType->loadRequirements( $taxRule->getRequirements() ); + + if($currentPosition !== $position) { + $untaxedPrice -= $currentFixTax; + $untaxedPrice = $untaxedPrice / (1+$currentTaxFactor); + $currentFixTax = 0; + $currentTaxFactor = 0; + $currentPosition = $position; + } + + $currentFixTax += $taxType->fixAmountRetriever(); + $currentTaxFactor += $taxType->pricePercentRetriever(); + + + } while($taxRule = $this->taxRulesCollection->getPrevious()); + + $untaxedPrice -= $currentFixTax; + $untaxedPrice = $untaxedPrice / (1+$currentTaxFactor); + + /*do { + + $taxType = $taxRule->getTypeInstance(); + $taxType->loadRequirements( $taxRule->getRequirements() ); + + $untaxedPrice -= $taxType->fixAmountRetriever(); + + } while($taxRule = $this->taxRulesCollection->getPrevious()); + + $taxRule = $this->taxRulesCollection->getLast(); + + $currentTaxFactor = 0; + do { + + $taxType = $taxRule->getTypeInstance(); + $taxType->loadRequirements( $taxRule->getRequirements() ); + + $currentTaxFactor += $taxType->pricePercentRetriever($untaxedPrice); + + $toto = true; + + } while($taxRule = $this->taxRulesCollection->getPrevious()); + + $untaxedPrice = $untaxedPrice / (1+$currentTaxFactor);*/ + + return $untaxedPrice; + } } diff --git a/core/lib/Thelia/TaxEngine/TaxType/BaseTaxType.php b/core/lib/Thelia/TaxEngine/TaxType/BaseTaxType.php index 7f487bf64..149e3f1df 100755 --- a/core/lib/Thelia/TaxEngine/TaxType/BaseTaxType.php +++ b/core/lib/Thelia/TaxEngine/TaxType/BaseTaxType.php @@ -36,6 +36,10 @@ abstract class BaseTaxType public abstract function calculate($untaxedPrice); + public abstract function pricePercentRetriever(); + + public abstract function fixAmountRetriever(); + public abstract function getRequirementsList(); public function loadRequirements($requirementsValues) diff --git a/core/lib/Thelia/TaxEngine/TaxType/FeatureSlicePercentTaxType.php b/core/lib/Thelia/TaxEngine/TaxType/FeatureSlicePercentTaxType.php index 4485f1e21..911439574 100755 --- a/core/lib/Thelia/TaxEngine/TaxType/FeatureSlicePercentTaxType.php +++ b/core/lib/Thelia/TaxEngine/TaxType/FeatureSlicePercentTaxType.php @@ -37,6 +37,16 @@ class featureSlicePercentTaxType extends BaseTaxType } + public function pricePercentRetriever() + { + + } + + public function fixAmountRetriever() + { + + } + public function getRequirementsList() { return array( diff --git a/core/lib/Thelia/TaxEngine/TaxType/FixAmountTaxType.php b/core/lib/Thelia/TaxEngine/TaxType/FixAmountTaxType.php index c533d0ec3..acd52bf8a 100755 --- a/core/lib/Thelia/TaxEngine/TaxType/FixAmountTaxType.php +++ b/core/lib/Thelia/TaxEngine/TaxType/FixAmountTaxType.php @@ -36,6 +36,16 @@ class FixAmountTaxType extends BaseTaxType return $this->getRequirement("amount"); } + public function pricePercentRetriever() + { + return 0; + } + + public function fixAmountRetriever() + { + return $this->getRequirement("amount"); + } + public function getRequirementsList() { return array( diff --git a/core/lib/Thelia/TaxEngine/TaxType/PricePercentTaxType.php b/core/lib/Thelia/TaxEngine/TaxType/PricePercentTaxType.php index 1d7152fcf..a8cd8c759 100755 --- a/core/lib/Thelia/TaxEngine/TaxType/PricePercentTaxType.php +++ b/core/lib/Thelia/TaxEngine/TaxType/PricePercentTaxType.php @@ -36,6 +36,16 @@ class PricePercentTaxType extends BaseTaxType return $untaxedPrice * $this->getRequirement("percent") * 0.01; } + public function pricePercentRetriever() + { + return ($this->getRequirement("percent") * 0.01); + } + + public function fixAmountRetriever() + { + return 0; + } + public function getRequirementsList() { return array( @@ -43,3 +53,5 @@ class PricePercentTaxType extends BaseTaxType ); } } + +//600 / (1 + 0,10 + 0,10) =/= 600 / (1 + 0,10 ) + 600 / (1 + 0,10 ) \ No newline at end of file diff --git a/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php b/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php index 165d5d517..e0443c5ba 100755 --- a/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php +++ b/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php @@ -112,17 +112,17 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase * @expectedException \Thelia\Exception\TaxEngineException * @expectedExceptionCode 503 */ - public function testGetTaxAmountBadTaxRulesCollection() + public function testGetTaxedPriceBadTaxRulesCollection() { $calculator = new Calculator(); - $calculator->getTaxAmount(500); + $calculator->getTaxedPrice(500); } /** * @expectedException \Thelia\Exception\TaxEngineException * @expectedExceptionCode 601 */ - public function testGetTaxAmountBadAmount() + public function testGetTaxedPriceBadAmount() { $taxRulesCollection = new ObjectCollection(); @@ -131,12 +131,11 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase $rewritingUrlQuery = $this->getProperty('taxRulesCollection'); $rewritingUrlQuery->setValue($calculator, $taxRulesCollection); - $calculator->getTaxAmount('foo'); + $calculator->getTaxedPrice('foo'); } - public function testGetTaxAmountAndGetTaxedPrice() + public function testGetTaxedPriceAndGetTaxAmountFromUntaxedPrice() { - /* consecutives taxes */ $taxRulesCollection = new ObjectCollection(); $taxRulesCollection->setModel('\Thelia\Model\Tax'); @@ -144,14 +143,24 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase $tax->setType('PricePercentTaxType') ->setRequirements(array('percent' => 10)) ->setVirtualColumn('taxRuleCountryPosition', 1); - $taxRulesCollection->append($tax); $tax = new Tax(); $tax->setType('PricePercentTaxType') ->setRequirements(array('percent' => 8)) + ->setVirtualColumn('taxRuleCountryPosition', 1); + $taxRulesCollection->append($tax); + + $tax = new Tax(); + $tax->setType('FixAmountTaxType') + ->setRequirements(array('amount' => 5)) ->setVirtualColumn('taxRuleCountryPosition', 2); + $taxRulesCollection->append($tax); + $tax = new Tax(); + $tax->setType('PricePercentTaxType') + ->setRequirements(array('percent' => 1)) + ->setVirtualColumn('taxRuleCountryPosition', 3); $taxRulesCollection->append($tax); $calculator = new Calculator(); @@ -159,19 +168,22 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase $rewritingUrlQuery = $this->getProperty('taxRulesCollection'); $rewritingUrlQuery->setValue($calculator, $taxRulesCollection); - $taxAmount = $calculator->getTaxAmount(500); + $taxAmount = $calculator->getTaxAmountFromUntaxedPrice(500); $taxedPrice = $calculator->getTaxedPrice(500); /* * expect : - * tax 1 = 500*0.10 = 50 // amout with tax 1 : 550 - * tax 2 = 550*0.08 = 44 // amout with tax 2 : 594 - * total tax amount = 94 + * tax 1 = 500*0.10 = 50 + 500*0.08 = 40 // amount with tax 1 : 590 + * tax 2 = 5 // amount with tax 2 : 595 + * tax 3 = 595 * 0.01 = 5.95 // amount with tax 3 : 600.95 + * total tax amount = 100.95 */ - $this->assertEquals(94, $taxAmount); - $this->assertEquals(594, $taxedPrice); + $this->assertEquals(100.95, $taxAmount); + $this->assertEquals(600.95, $taxedPrice); + } - /* same position taxes */ + public function testGetUntaxedPriceAndGetTaxAmountFromTaxedPrice() + { $taxRulesCollection = new ObjectCollection(); $taxRulesCollection->setModel('\Thelia\Model\Tax'); @@ -179,14 +191,24 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase $tax->setType('PricePercentTaxType') ->setRequirements(array('percent' => 10)) ->setVirtualColumn('taxRuleCountryPosition', 1); - $taxRulesCollection->append($tax); $tax = new Tax(); $tax->setType('PricePercentTaxType') ->setRequirements(array('percent' => 8)) ->setVirtualColumn('taxRuleCountryPosition', 1); + $taxRulesCollection->append($tax); + $tax = new Tax(); + $tax->setType('FixAmountTaxType') + ->setRequirements(array('amount' => 5)) + ->setVirtualColumn('taxRuleCountryPosition', 2); + $taxRulesCollection->append($tax); + + $tax = new Tax(); + $tax->setType('PricePercentTaxType') + ->setRequirements(array('percent' => 1)) + ->setVirtualColumn('taxRuleCountryPosition', 3); $taxRulesCollection->append($tax); $calculator = new Calculator(); @@ -194,16 +216,17 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase $rewritingUrlQuery = $this->getProperty('taxRulesCollection'); $rewritingUrlQuery->setValue($calculator, $taxRulesCollection); - $taxAmount = $calculator->getTaxAmount(500); - $taxedPrice = $calculator->getTaxedPrice(500); + $taxAmount = $calculator->getTaxAmountFromTaxedPrice(600.95); + $untaxedPrice = $calculator->getUntaxedPrice(600.95); /* * expect : - * tax 1 = 500*0.10 = 50 // amout with tax 1 : 550 - * tax 2 = 500*0.08 = 40 // amout with tax 2 : 590 - * total tax amount = 90 + * tax 3 = 600.95 - 600.95 / (1 + 0.01) = 5,95 // amount without tax 3 : 595 + * tax 2 = 5 // amount without tax 2 : 590 + * tax 1 = 590 - 590 / (1 + 0.08 + 0.10) = 90 // amount without tax 1 : 500 + * total tax amount = 100.95 */ - $this->assertEquals(90, $taxAmount); - $this->assertEquals(590, $taxedPrice); + $this->assertEquals(100.95, $taxAmount); + $this->assertEquals(500, $untaxedPrice); } } From 8b0c8bd760262c92120b8bc45cf79f7ad2cb6f9b Mon Sep 17 00:00:00 2001 From: mespeche Date: Fri, 13 Sep 2013 18:03:45 +0200 Subject: [PATCH 7/7] First version of installation wizard --- .../Config/Resources/routing/install.xml | 20 ++- .../Install/BaseInstallController.php | 2 +- .../Controller/Install/InstallController.php | 51 ++++++- core/lib/Thelia/Install/BaseInstall.php | 3 +- .../default/assets/less/thelia/thelia.less | 1 + .../default/assets/less/thelia/wizard.less | 129 ++++++++++++++++++ templates/install/index.html | 52 +++++-- templates/install/layout.html | 49 ------- templates/install/layout.tpl | 62 +++++++++ templates/install/step-2.html | 51 +++++++ templates/install/step-3.html | 56 ++++++++ templates/install/step-4.html | 77 +++++++++++ templates/install/step-5.html | 72 ++++++++++ templates/install/thanks.html | 42 ++++++ 14 files changed, 601 insertions(+), 66 deletions(-) create mode 100644 templates/admin/default/assets/less/thelia/wizard.less delete mode 100644 templates/install/layout.html create mode 100644 templates/install/layout.tpl create mode 100644 templates/install/step-2.html create mode 100644 templates/install/step-3.html create mode 100644 templates/install/step-4.html create mode 100644 templates/install/step-5.html create mode 100644 templates/install/thanks.html diff --git a/core/lib/Thelia/Config/Resources/routing/install.xml b/core/lib/Thelia/Config/Resources/routing/install.xml index d53763948..37ddde487 100644 --- a/core/lib/Thelia/Config/Resources/routing/install.xml +++ b/core/lib/Thelia/Config/Resources/routing/install.xml @@ -4,12 +4,28 @@ 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"> - + Thelia\Controller\Install\InstallController::index - + Thelia\Controller\Install\InstallController::checkPermission + + Thelia\Controller\Install\InstallController::databaseConnection + + + + Thelia\Controller\Install\InstallController::databaseSelection + + + + Thelia\Controller\Install\InstallController::generalInformation + + + + Thelia\Controller\Install\InstallController::thanks + + diff --git a/core/lib/Thelia/Controller/Install/BaseInstallController.php b/core/lib/Thelia/Controller/Install/BaseInstallController.php index 35293904e..bac7a4f19 100644 --- a/core/lib/Thelia/Controller/Install/BaseInstallController.php +++ b/core/lib/Thelia/Controller/Install/BaseInstallController.php @@ -39,7 +39,7 @@ class BaseInstallController extends BaseController { $parser = $this->container->get("thelia.parser"); - // Define the template thant shoud be used + // Define the template that shoud be used $parser->setTemplate("install"); return $parser; diff --git a/core/lib/Thelia/Controller/Install/InstallController.php b/core/lib/Thelia/Controller/Install/InstallController.php index 0514ba0ff..40e6643db 100644 --- a/core/lib/Thelia/Controller/Install/InstallController.php +++ b/core/lib/Thelia/Controller/Install/InstallController.php @@ -33,18 +33,61 @@ class InstallController extends BaseInstallController { public function index() { - $this->verifyStep(1); + //$this->verifyStep(1); $this->getSession()->set("step", 1); - $this->render("index.html"); + return $this->render("index.html"); } public function checkPermission() { - $this->verifyStep(2); + //$this->verifyStep(2); - $permission = new CheckPermission(); + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 2); + return $this->render("step-2.html"); + } + + public function databaseConnection() + { + //$this->verifyStep(2); + + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 3); + return $this->render("step-3.html"); + } + + public function databaseSelection() + { + //$this->verifyStep(2); + + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 4); + return $this->render("step-4.html"); + } + + public function generalInformation() + { + //$this->verifyStep(2); + + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 5); + return $this->render("step-5.html"); + } + + public function thanks() + { + //$this->verifyStep(2); + + //$permission = new CheckPermission(); + + $this->getSession()->set("step", 6); + return $this->render("thanks.html"); } protected function verifyStep($step) diff --git a/core/lib/Thelia/Install/BaseInstall.php b/core/lib/Thelia/Install/BaseInstall.php index 58c510267..11b8d0999 100644 --- a/core/lib/Thelia/Install/BaseInstall.php +++ b/core/lib/Thelia/Install/BaseInstall.php @@ -34,9 +34,10 @@ abstract class BaseInstall */ public function __construct($verifyInstall = true) { + /* TODO : activate this part if (file_exists(THELIA_ROOT . '/local/config/database.yml') && $verifyInstall) { throw new AlreadyInstallException("Thelia is already installed"); - } + }*/ $this->exec(); diff --git a/templates/admin/default/assets/less/thelia/thelia.less b/templates/admin/default/assets/less/thelia/thelia.less index ac525566f..50cd9bde6 100644 --- a/templates/admin/default/assets/less/thelia/thelia.less +++ b/templates/admin/default/assets/less/thelia/thelia.less @@ -8,6 +8,7 @@ @import "modals.less"; @import "tables.less"; @import "tablesorter.less"; +@import "wizard.less"; @import "bootstrap-editable.less"; @import "bootstrap-switch.less"; diff --git a/templates/admin/default/assets/less/thelia/wizard.less b/templates/admin/default/assets/less/thelia/wizard.less new file mode 100644 index 000000000..0d130a2d5 --- /dev/null +++ b/templates/admin/default/assets/less/thelia/wizard.less @@ -0,0 +1,129 @@ +.wizard { + background-color: #fff; + border: 1px solid #d4d4d4; + border-radius: 4px; + .box-shadow(0 1px 4px rgba(0, 0, 0, 0.065)); + *zoom: 1; + margin-bottom: 20px; + + &:before, + &:after { + display: table; + line-height: 0; + content: ""; + clear: both; + } + + ul { + padding: 0; + margin: 0; + list-style: none outside none; + } + + li { + position: relative; + float: left; + height: 46px; + padding: 0 10px 0 30px; + margin: 0; + font-size: 15px; + line-height: 46px; + color: #999999; + cursor: default; + background: #ededed; + + &.complete { + color: #468847; + background: #f3f4f5; + + &:hover{ + background: #e8e8e8; + + .chevron:before { + border-left: 14px solid #e8e8e8; + } + } + + a{ + color: inherit; + text-decoration: none; + font-weight: normal; + } + + .chevron:before { + border-left: 14px solid #f3f4f5; + } + + } + + &.active { + color: @link-color; + background: #fff; + + .chevron:before { + border-left: 14px solid #fff; + } + } + + .chevron { + position: absolute; + top: 0; + right: -14px; + display: block; + border: 24px solid transparent; + border-right: 0; + border-left: 14px solid #d4d4d4; + + &:before { + position: absolute; + top: -24px; + right: 1px; + display: block; + border: 24px solid transparent; + border-right: 0; + border-left: 14px solid #ededed; + content: ""; + } + + } + + .badge { + margin-right: 8px; + } + + &:nth-child(1) { + z-index: 10; + padding-left: 20px; + border-radius: 4px 0 0 4px; + } + &:nth-child(2) { + z-index: 9; + } + &:nth-child(3) { + z-index: 8; + } + &:nth-child(4) { + z-index: 7; + } + &:nth-child(5) { + z-index: 6; + } + &:nth-child(6) { + z-index: 5; + } + &:nth-child(7) { + z-index: 4; + } + &:nth-child(8) { + z-index: 3; + } + &:nth-child(9) { + z-index: 2; + } + &:nth-child(10) { + z-index: 1; + } + + } + +} \ No newline at end of file diff --git a/templates/install/index.html b/templates/install/index.html index a996cc241..dd1d5f62b 100644 --- a/templates/install/index.html +++ b/templates/install/index.html @@ -1,12 +1,46 @@ -{extends file="layout.html"} -{block name="content"} -

{intl l="Thelia installation wizard"}

-
+{extends file="layout.tpl"} - {intl l="Bienvenue au sein du programme d'installation de Thelia."}
- {intl l="Nous allons vous guider tout au long de ce processus afin d'installer l'application sur votre système."}

+{block name="page-title"}{intl l='Installation'}{/block} -
- - +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ +
+
    +
  • 1{intl l="Welcome"}
  • +
  • 2{intl l="Checking permissions"}
  • +
  • 3{intl l="Database connection"}
  • +
  • 4{intl l="Database selection"}
  • +
  • 5{intl l="General information"}
  • +
  • 6{intl l="Thanks"}
  • +
+
+ +
+

+ {intl l="Welcome in the Thelia installation wizard."} +

+

+ {intl l="We will guide you throughout this process to install any application on your system."} +

+ +
+ + + +
+
+
+ +
+
{/block} \ No newline at end of file diff --git a/templates/install/layout.html b/templates/install/layout.html deleted file mode 100644 index 0a13586ad..000000000 --- a/templates/install/layout.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - {block name="title"}Thelia Install{/block} - - {images file='../admin/default/assets/img/favicon.ico'}{/images} - - - - {stylesheets file='../admin/default/assets/bootstrap/css/bootstrap.css' filters='cssembed'} - - {/stylesheets} - - {stylesheets file='../admin/default/assets/bootstrap/css/bootstrap-responsive.css' filters='cssembed'} - - {/stylesheets} - - - {stylesheets file='../admin/default/assets/css/*' filters='less,cssembed'} - - {/stylesheets} - - - -
-
-
{intl l='Version %ver' ver="{$THELIA_VERSION}"}
-
-
-
- {block name="content"}{/block} -
- -
- - - - \ No newline at end of file diff --git a/templates/install/layout.tpl b/templates/install/layout.tpl new file mode 100644 index 000000000..4539ce32f --- /dev/null +++ b/templates/install/layout.tpl @@ -0,0 +1,62 @@ + + + + {block name="page-title"}Thelia Install{/block} + + {images file='../admin/default/assets/img/favicon.ico'}{/images} + + + + {stylesheets file='../admin/default/assets/less/*' filters='less,cssembed'} + + {/stylesheets} + + + +
+
+ +
+
+
{intl l='Version %ver' ver="{$THELIA_VERSION}"}
+
+
+ +
+
+ + {* -- Main page content section ----------------------------------------- *} + + {block name="main-content"}Put here the content of the template{/block} + + {* -- Footer section ---------------------------------------------------- *} + +
+ + + {* -- Javascript section ------------------------------------------------ *} + + + + {block name="after-javascript-include"}{/block} + + {javascripts file='../admin/default/assets/js/bootstrap/bootstrap.js'} + + {/javascripts} + + {block name="javascript-initialization"}{/block} + + + \ No newline at end of file diff --git a/templates/install/step-2.html b/templates/install/step-2.html new file mode 100644 index 000000000..fc24d25cb --- /dev/null +++ b/templates/install/step-2.html @@ -0,0 +1,51 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Installation step 2'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ +
+
    +
  • 1{intl l="Welcome"}
  • +
  • 2{intl l="Checking permissions"}
  • +
  • 3{intl l="Database connection"}
  • +
  • 4{intl l="Database selection"}
  • +
  • 5{intl l="General information"}
  • +
  • 6{intl l="Thanks"}
  • +
+
+ +
+

We will check some rights to files and directories...

+
    +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
  • Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
  • +
+ +
+ + + +
+
+
+ +
+
+{/block} \ No newline at end of file diff --git a/templates/install/step-3.html b/templates/install/step-3.html new file mode 100644 index 000000000..cb4157dd7 --- /dev/null +++ b/templates/install/step-3.html @@ -0,0 +1,56 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Installation step 3'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ +
+ +
+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+ + +
+ + + +
+
+
+ +
+
+{/block} \ No newline at end of file diff --git a/templates/install/step-4.html b/templates/install/step-4.html new file mode 100644 index 000000000..981be34bb --- /dev/null +++ b/templates/install/step-4.html @@ -0,0 +1,77 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Installation step 4'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ +
+ +
+ +
+
+
+ {intl l="Choose your database"} +

+ The SQL server contains multiple databases.
+ Select below the one you want to use. +

+ +
+ +
+
+ +
+ +

+ {intl l="or"} +

+ +
+ +
+ +
+ +
+
+ +
+ + + +
+
+
+ +
+
+{/block} \ No newline at end of file diff --git a/templates/install/step-5.html b/templates/install/step-5.html new file mode 100644 index 000000000..611a86a20 --- /dev/null +++ b/templates/install/step-5.html @@ -0,0 +1,72 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Installation step 4'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ + + +
+
+ +

+ The system will now you create a custom site access. +

+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + + +
+
+
+ +
+
+{/block} \ No newline at end of file diff --git a/templates/install/thanks.html b/templates/install/thanks.html new file mode 100644 index 000000000..b6ed27065 --- /dev/null +++ b/templates/install/thanks.html @@ -0,0 +1,42 @@ +{extends file="layout.tpl"} + +{block name="page-title"}{intl l='Thanks'}{/block} + +{block name="main-content"} +
+
+ +
+
+
+ +

{intl l="Thelia installation wizard"}

+ + + +
+

+ {intl l="Thank you have installed Thelia"}. +

+

+ {intl l="You will be redirected to your personal space in order to manage your store now."} +

+ +
+ +
+
+
+ +
+
+{/block} \ No newline at end of file