Merge branch 'master' of https://github.com/thelia/thelia
This commit is contained in:
@@ -22,10 +22,14 @@
|
||||
/*************************************************************************************/
|
||||
|
||||
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\AddressEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Model\Address as AddressModel;
|
||||
use Thelia\Model\Map\AddressTableMap;
|
||||
|
||||
/**
|
||||
* Class Address
|
||||
@@ -49,31 +53,51 @@ 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());
|
||||
$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()
|
||||
;
|
||||
|
||||
$event->setAddress($addressModel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,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)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,18 +59,29 @@
|
||||
<!-- end customer routes -->
|
||||
|
||||
<!-- customer address routes -->
|
||||
<route id="address.create" path="/address/create" >
|
||||
<route id="address.create.view" path="/address/create" methods="get">
|
||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
||||
<default key="_view">address</default>
|
||||
</route>
|
||||
|
||||
<route id="address.create" path="/address/create" methods="post" >
|
||||
<default key="_controller">Thelia\Controller\Front\AddressController::createAction</default>
|
||||
<default key="_view">address</default>
|
||||
</route>
|
||||
|
||||
<route id="address.edit" path="/address/edit/{address_id}">
|
||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
||||
<default key="_view">address-edit</default>
|
||||
<route id="address.edit" path="/address/update/{address_id}" methods="get">
|
||||
<default key="_controller">Thelia\Controller\Front\AddressController::updateViewAction</default>
|
||||
<default key="_view">address-update</default>
|
||||
</route>
|
||||
|
||||
<route id="address.update" path="/address/update" >
|
||||
<default key="_controller">Thelia\Controller\Front\AddressController::updateAction</default>
|
||||
<route id="address.update" path="/address/update/{address_id}" methods="post" >
|
||||
<default key="_controller">Thelia\Controller\Front\AddressController::processUpdateAction</default>
|
||||
<default key="_view">address-update</default>
|
||||
</route>
|
||||
|
||||
<route id="address.delete" path="/address/delete/{address_id}">
|
||||
<default key="_controller">Thelia\Controller\Front\AddressController::deleteAction</default>
|
||||
<default key="_view">account</default>
|
||||
</route>
|
||||
|
||||
<route id="address.generateModal" path="/address/modal/{address_id}" methods="get">
|
||||
|
||||
@@ -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">
|
||||
|
||||
<route id="home" path="/install" >
|
||||
<route id="install.step1" path="/install" >
|
||||
<default key="_controller">Thelia\Controller\Install\InstallController::index</default>
|
||||
</route>
|
||||
|
||||
<route id="home" path="/install/step/2" >
|
||||
<route id="install.step2" path="/install/step/2" >
|
||||
<default key="_controller">Thelia\Controller\Install\InstallController::checkPermission</default>
|
||||
</route>
|
||||
|
||||
<route id="install.step3" path="/install/step/3" >
|
||||
<default key="_controller">Thelia\Controller\Install\InstallController::databaseConnection</default>
|
||||
</route>
|
||||
|
||||
<route id="install.step4" path="/install/step/4" >
|
||||
<default key="_controller">Thelia\Controller\Install\InstallController::databaseSelection</default>
|
||||
</route>
|
||||
|
||||
<route id="install.step5" path="/install/step/5" >
|
||||
<default key="_controller">Thelia\Controller\Install\InstallController::generalInformation</default>
|
||||
</route>
|
||||
|
||||
<route id="install.step6" path="/install/thanks" >
|
||||
<default key="_controller">Thelia\Controller\Install\InstallController::thanks</default>
|
||||
</route>
|
||||
|
||||
</routes>
|
||||
|
||||
@@ -23,11 +23,12 @@
|
||||
|
||||
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;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Model\Base\AddressQuery;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\Customer;
|
||||
use Thelia\Tools\URL;
|
||||
|
||||
@@ -46,14 +47,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 +62,7 @@ class AddressController extends BaseFrontController
|
||||
*/
|
||||
public function createAction()
|
||||
{
|
||||
if ($this->getSecurityContext()->hasCustomerUser() === false) {
|
||||
$this->accessDenied()
|
||||
}
|
||||
$this->checkAuth();
|
||||
|
||||
$addressCreate = new AddressCreateForm($this->getRequest());
|
||||
|
||||
@@ -96,20 +94,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 ($this->getSecurityContext()->hasCustomerUser() === false) {
|
||||
$this->redirectToRoute("home");
|
||||
}
|
||||
|
||||
if (null === $address_id = $request->get("address_id")) {
|
||||
$this->redirectToRoute("home");
|
||||
}
|
||||
|
||||
$addressUpdate = new AddressUpdateForm($request);
|
||||
|
||||
|
||||
try {
|
||||
$customer = $this->getSecurityContext()->getCustomerUser();
|
||||
|
||||
@@ -136,7 +142,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));
|
||||
|
||||
@@ -149,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(
|
||||
@@ -164,7 +186,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()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
))
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -37,6 +37,16 @@ class featureSlicePercentTaxType extends BaseTaxType
|
||||
|
||||
}
|
||||
|
||||
public function pricePercentRetriever()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function fixAmountRetriever()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getRequirementsList()
|
||||
{
|
||||
return array(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 )
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
tfoot{
|
||||
|
||||
.pagination{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.table-condensed {
|
||||
tfoot {
|
||||
> tr {
|
||||
> th,
|
||||
> td {
|
||||
padding: 20px 5px 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table-striped {
|
||||
|
||||
caption {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
@import "modals.less";
|
||||
@import "tables.less";
|
||||
@import "tablesorter.less";
|
||||
@import "wizard.less";
|
||||
@import "bootstrap-editable.less";
|
||||
@import "bootstrap-switch.less";
|
||||
|
||||
|
||||
129
templates/admin/default/assets/less/thelia/wizard.less
Normal file
129
templates/admin/default/assets/less/thelia/wizard.less
Normal file
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -102,6 +102,39 @@
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
|
||||
<div class="text-center">
|
||||
<ul class="pagination pagination-centered">
|
||||
{if $customer_page != 1}
|
||||
<li><a href="{url path="/admin/customers" page="1"}">«</a></li>
|
||||
{else}
|
||||
<li class="disabled"><a href="#">«</a></li>
|
||||
{/if}
|
||||
|
||||
{pageloop rel="customer_list"}
|
||||
{if $PAGE != $CURRENT}
|
||||
<li><a href="{url path="/admin/customers" page="{$PAGE}"}">{$PAGE}</a></li>
|
||||
|
||||
{else}
|
||||
<li class="active"><a href="#">{$PAGE}</a></li>
|
||||
{/if}
|
||||
|
||||
|
||||
{/pageloop}
|
||||
{if $PAGE == $LAST && $LAST != $CURRENT}
|
||||
<li><a href="{url path="/admin/customers" page="$PAGE"}">»</a></li>
|
||||
{else}
|
||||
<li class="disabled"><a href="#">»</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
{/ifloop}
|
||||
</table>
|
||||
</div>
|
||||
@@ -110,35 +143,6 @@
|
||||
|
||||
|
||||
{module_include location='customer_bottom'}
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
|
||||
<ul class="pagination pagination-centered">
|
||||
{if $customer_page != 1}
|
||||
<li><a href="{url path="/admin/customers" page="1"}">«</a></li>
|
||||
{else}
|
||||
<li class="disabled"><a href="#">«</a></li>
|
||||
{/if}
|
||||
|
||||
{pageloop rel="customer_list"}
|
||||
{if $PAGE != $CURRENT}
|
||||
<li><a href="{url path="/admin/customers" page="{$PAGE}"}">{$PAGE}</a></li>
|
||||
|
||||
{else}
|
||||
<li class="active"><a href="#">{$PAGE}</a></li>
|
||||
{/if}
|
||||
|
||||
|
||||
{/pageloop}
|
||||
{if $PAGE == $LAST && $LAST != $CURRENT}
|
||||
<li><a href="{url path="/admin/customers" page="$PAGE"}">»</a></li>
|
||||
{else}
|
||||
<li class="disabled"><a href="#">»</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Adding a new Category *}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{check_auth context="front" roles="CUSTOMER" login_tpl="login"}
|
||||
{extends file="layout.tpl"}
|
||||
|
||||
{block name="breadcrumb"}
|
||||
@@ -74,11 +75,11 @@
|
||||
</div>
|
||||
<div id="account-address" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<a href="address.php" class="btn btn-add-address">{intl l="Add a new address"}</a>
|
||||
<a href="{url path="/address/create"}" class="btn btn-add-address">{intl l="Add a new address"}</a>
|
||||
<table class="table table-address" role="presentation" summary="{intl l="My Address Books"}">
|
||||
<tbody>
|
||||
{loop type="address" name="customer.addresses"}
|
||||
<tr class="{if $DEFAULT == 1}address-primary{else}address-additional{/if}">
|
||||
{loop type="address" name="customer.addresses" customer="current"}
|
||||
<tr class="{if $DEFAULT == 1}address-primary{else}address-additional{/if}" id="customer-address-{$ID}">
|
||||
<th>{$LABEL}</th>
|
||||
<td>
|
||||
<ul class="list-address">
|
||||
@@ -113,9 +114,9 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="group-btn">
|
||||
<a href="{url path="/address/edit/{$ID}"}" class="btn btn-edit-address" data-toggle="tooltip" title="Edit this address"><i class="icon-pencil"></i> <span>{intl l="Edit"}</span></a>
|
||||
<a href="{url path="/address/update/{$ID}"}" class="btn btn-edit-address" data-toggle="tooltip" title="Edit this address"><i class="icon-pencil"></i> <span>{intl l="Edit"}</span></a>
|
||||
{if $DEFAULT != 1}
|
||||
<a href="#" class="btn btn-remove-address" data-toggle="tooltip" title="Remove this address"><i class="icon-remove"></i> <span>{intl l="Cancel"}</span></a>
|
||||
<a href="{url path="/address/delete/{$ID}"}" class="btn btn-remove-address remove-address" title="{intl l="Remove this address"}" data-toggle="tooltip"><i class="icon-remove"></i> <span>{intl l="Cancel"}</span></a>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
@@ -172,4 +173,37 @@
|
||||
|
||||
</div><!-- /.layout -->
|
||||
|
||||
<div class="modal fade" id="address-delete-modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Delete address"}</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{intl l="Do you really want to delete this address ?"}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" type="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true"><span class="glyphicon glyphicon-remove"></span> {intl l="No"}</a>
|
||||
<a href="#" id="address-delete-link" type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span> {intl l="Yes"}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="after-javascript-include"}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$(".remove-address").click(function(e){
|
||||
e.preventDefault();
|
||||
$("#address-delete-link").attr("href", $(this).attr("href"));
|
||||
$('#address-delete-modal').modal('show');
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
250
templates/default/address-update.html
Normal file
250
templates/default/address-update.html
Normal file
@@ -0,0 +1,250 @@
|
||||
{check_auth context="front" roles="CUSTOMER" login_tpl="login"}
|
||||
{extends file="layout.tpl"}
|
||||
{block name="breadcrumb"}
|
||||
<nav class="nav-breadcrumb" role="navigation" aria-labelledby="breadcrumb-label">
|
||||
<strong id="breadcrumb-label">{intl l="You are here"}: </strong>
|
||||
<ul class="breadcrumb" itemprop="breadcrumb">
|
||||
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="index.php" itemprop="url"><span itemprop="title">{intl l="Home"}</span></a></li>
|
||||
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><span itemprop="title">{intl l="Account"}</span></li>
|
||||
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active"><span itemprop="title">{intl l="Address"}</span></li>
|
||||
</ul>
|
||||
</nav><!-- /.nav-breadcrumb -->
|
||||
{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="main">
|
||||
|
||||
<article class="col-main" role="main" aria-labelledby="main-label">
|
||||
|
||||
<h1 id="main-label" class="page-header">{intl l="Create New Address"}</h1>
|
||||
{form name="thelia.address.update"}
|
||||
{loop name="customer.update" type="address" customer="current" id="{$address_id}"}
|
||||
<form id="form-address" class="form-horizontal" action="{url path="/address/update/{$address_id}"}" method="post" role="form">
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path="/customer/account"}" /> {* the url the user is redirected to on login success *}
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='error_message'}
|
||||
<input type="hidden" name="{$name}" value="{intl l="missing or invalid data"}" /> {* the url the user is redirected to on login success *}
|
||||
{/form_field}
|
||||
{form_hidden_fields form=$form}
|
||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||
<fieldset class="panel">
|
||||
<div class="panel-heading">
|
||||
{intl l="Address"}
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
{form_field form=$form field="label"}
|
||||
<div class="form-group group-label {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value|default:{$LABEL}}" id="{$label_attr.for}" class="form-control" placeholder="{intl l="Home address"}" autofocus>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="title"}
|
||||
{assign var="customer_title_id" value="{$value|default:$TITLE}"}
|
||||
<div class="form-group group-title {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
|
||||
<div class="control-input">
|
||||
<select name="{$name}" id="{$label_attr.for}" class="form-control" required autofocus>
|
||||
<option value="">-- {intl l="Select Title"} --</option>
|
||||
{loop type="title" name="title.list"}
|
||||
<option value="{$ID}" {if $customer_title_id == $ID}selected{/if} >{$LONG}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div><!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="firstname"}
|
||||
<div class="form-group group-firstname {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value|default:{$FIRSTNAME}}" id="{$label_attr.for}" class="form-control" placeholder="John" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
<!--/.form-group-->
|
||||
|
||||
{form_field form=$form field="lastname"}
|
||||
<div class="form-group group-lastname {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value|default:{$LASTNAME}}" id="{$label_attr.for}" class="form-control" placeholder="Doe" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="address1"}
|
||||
<div class="form-group group-address1 {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value|default:{$ADDRESS1}}" id="{$label_attr.for}" class="form-control" placeholder="Street address" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="address2"}
|
||||
<div class="form-group group-address2 {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: </label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value|default:{$ADDRESS2}}" id="{$label_attr.for}" class="form-control" placeholder="{intl l="Complementary address"}">
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="zipcode"}
|
||||
<div class="form-group group-zipcode {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value|default:{$ZIPCODE}}" id="{$label_attr.for}" class="form-control" placeholder="H2T 2V6" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="city"}
|
||||
<div class="form-group group-city {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value|default:{$CITY}}" id="{$label_attr.for}" class="form-control" placeholder="New York" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="country"}
|
||||
{assign var="customer_country_id" value="{$value|default:$COUNTRY}"}
|
||||
<div class="form-group group-country {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
|
||||
<div class="control-input">
|
||||
<select name="{$name}" id="{$label_attr.for}" class="form-control" required>
|
||||
<option value="">-- {intl l="Select Country"} --</option>
|
||||
{loop type="country" name="country.list"}
|
||||
<option value="{$ID}" {if $customer_country_id == $ID}selected{/if} >{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div><!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="phone"}
|
||||
<div class="form-group group-phone {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: </label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value|default:{$PHONE}}" id="{$label_attr.for}" class="form-control" placeholder="">
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="cellphone"}
|
||||
<div class="form-group group-cellphone {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: </label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value|default:{$CELLPHONE}}" id="{$label_attr.for}" class="form-control" placeholder="">
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
{form_field form=$form field="is_default"}
|
||||
<div class="form-group group-primary">
|
||||
<div class="control-input">
|
||||
<div class="checkbox">
|
||||
<label class="control-label" for="{$label_attr.for}">
|
||||
<input type="checkbox" name="{$name}" id="{$label_attr.for}" value="1" {if $DEFAULT}checked{/if}> {$label}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
<div class="form-group group-btn">
|
||||
<div class="control-btn">
|
||||
<button type="submit" class="btn btn-submit">{intl l="Create"}</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
</form>
|
||||
{/loop}
|
||||
{/form}
|
||||
</article>
|
||||
|
||||
</div><!-- /.layout -->
|
||||
{/block}
|
||||
247
templates/default/address.html
Normal file
247
templates/default/address.html
Normal file
@@ -0,0 +1,247 @@
|
||||
{check_auth context="front" roles="CUSTOMER" login_tpl="login"}
|
||||
{extends file="layout.tpl"}
|
||||
|
||||
{block name="breadcrumb"}
|
||||
<nav class="nav-breadcrumb" role="navigation" aria-labelledby="breadcrumb-label">
|
||||
<strong id="breadcrumb-label">You are here: </strong>
|
||||
<ul class="breadcrumb" itemprop="breadcrumb">
|
||||
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="index.php" itemprop="url"><span itemprop="title">Home</span></a></li>
|
||||
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="index.php" itemprop="url"><span itemprop="title">Account</span></a></li>
|
||||
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active"><span itemprop="title">{intl l="Address"}</span></li>
|
||||
</ul>
|
||||
</nav><!-- /.nav-breadcrumb -->
|
||||
{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="main">
|
||||
|
||||
<article class="col-main" role="main" aria-labelledby="main-label">
|
||||
|
||||
<h1 id="main-label" class="page-header">{intl l="Create New Address"}</h1>
|
||||
{form name="thelia.address.create"}
|
||||
<form id="form-address" class="form-horizontal" action="{url path="/address/create"}" method="post" role="form">
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path="/customer/account"}" /> {* the url the user is redirected to on login success *}
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='error_message'}
|
||||
<input type="hidden" name="{$name}" value="{intl l="missing or invalid data"}" /> {* the url the user is redirected to on login success *}
|
||||
{/form_field}
|
||||
{form_hidden_fields form=$form}
|
||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||
<fieldset class="panel">
|
||||
<div class="panel-heading">
|
||||
{intl l="Address"}
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
{form_field form=$form field="label"}
|
||||
<div class="form-group group-label {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" placeholder="{intl l="Home address"}" autofocus>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="title"}
|
||||
<div class="form-group group-title {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
|
||||
<div class="control-input">
|
||||
<select name="{$name}" id="{$label_attr.for}" class="form-control" required autofocus>
|
||||
<option value="">-- {intl l="Select Title"} --</option>
|
||||
{loop type="title" name="title.list"}
|
||||
<option value="{$ID}" {if $value == $ID}selected{/if} >{$LONG}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div><!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="firstname"}
|
||||
<div class="form-group group-firstname {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" placeholder="John" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
<!--/.form-group-->
|
||||
|
||||
{form_field form=$form field="lastname"}
|
||||
<div class="form-group group-lastname {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" placeholder="Doe" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="address1"}
|
||||
<div class="form-group group-address1 {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" placeholder="Street address" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="address2"}
|
||||
<div class="form-group group-address2 {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: </label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" placeholder="{intl l="Complementary address"}">
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="zipcode"}
|
||||
<div class="form-group group-zipcode {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" placeholder="H2T 2V6" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="city"}
|
||||
<div class="form-group group-city {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: <span class="required">*</span></label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" placeholder="New York" required>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="country"}
|
||||
<div class="form-group group-country {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
|
||||
<div class="control-input">
|
||||
<select name="{$name}" id="{$label_attr.for}" class="form-control" required>
|
||||
<option value="">-- {intl l="Select Country"} --</option>
|
||||
{loop type="country" name="country.list"}
|
||||
<option value="{$ID}" {if $value == $ID}selected{/if} >{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div><!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="phone"}
|
||||
<div class="form-group group-phone {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: </label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" placeholder="">
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field="cellphone"}
|
||||
<div class="form-group group-cellphone {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}: </label>
|
||||
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" placeholder="">
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
<span class="help-block"><i class="icon-ok"></i></span>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
{form_field form=$form field="is_default"}
|
||||
<div class="form-group group-primary">
|
||||
<div class="control-input">
|
||||
<div class="checkbox">
|
||||
<label class="control-label" for="{$label_attr.for}">
|
||||
<input type="checkbox" name="{$name}" id="{$label_attr.for}" value="1"> {$label}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
{/form_field}
|
||||
|
||||
<div class="form-group group-btn">
|
||||
<div class="control-btn">
|
||||
<button type="submit" class="btn btn-submit">{intl l="Create"}</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--/.form-group-->
|
||||
</form>
|
||||
{/form}
|
||||
</article>
|
||||
|
||||
</div><!-- /.layout -->
|
||||
{/block}
|
||||
@@ -96,7 +96,7 @@
|
||||
<div class="form-group group-phone {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}</label>
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus>
|
||||
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="" value="{$value}" autofocus>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
@@ -109,7 +109,7 @@
|
||||
<div class="form-group group-cellphone {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}</label>
|
||||
<div class="control-input">
|
||||
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus>
|
||||
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="" value="{$value}" autofocus>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{elseif $value != "" && !$error}
|
||||
|
||||
@@ -1,12 +1,46 @@
|
||||
{extends file="layout.html"}
|
||||
{block name="content"}
|
||||
<h1>{intl l="Thelia installation wizard"}</h1>
|
||||
<br />
|
||||
{extends file="layout.tpl"}
|
||||
|
||||
{intl l="Bienvenue au sein du programme d'installation de Thelia."}<br />
|
||||
{intl l="Nous allons vous guider tout au long de ce processus afin d'installer l'application sur votre système."}<br /><br />
|
||||
{block name="page-title"}{intl l='Installation'}{/block}
|
||||
|
||||
<form action="{url path="/install/step/2" }" method="post">
|
||||
<input type="submit" value="Continuer" />
|
||||
</form>
|
||||
{block name="main-content"}
|
||||
<div class="install">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
|
||||
|
||||
<div class="wizard">
|
||||
<ul>
|
||||
<li class="active"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="well">
|
||||
<p class="lead text-center">
|
||||
{intl l="Welcome in the Thelia installation wizard."}
|
||||
</p>
|
||||
<p class="text-center">
|
||||
{intl l="We will guide you throughout this process to install any application on your system."}
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<a href="install/step/2" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -1,49 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{$lang_code}">
|
||||
<head>
|
||||
<title>{block name="title"}Thelia Install{/block}</title>
|
||||
|
||||
{images file='../admin/default/assets/img/favicon.ico'}<link rel="shortcut icon" href="{$asset_url}" />{/images}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
{stylesheets file='../admin/default/assets/bootstrap/css/bootstrap.css' filters='cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{stylesheets file='../admin/default/assets/bootstrap/css/bootstrap-responsive.css' filters='cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
|
||||
{stylesheets file='../admin/default/assets/css/*' filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<div class="container">
|
||||
<div class="version-info">{intl l='Version %ver' ver="{$THELIA_VERSION}"}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wrapper" class="container">
|
||||
{block name="content"}{/block}
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<p>{intl l='© Thelia 2013'}
|
||||
- <a href="http://www.openstudio.fr/" target="_blank">{intl l='Édité par OpenStudio'}</a>
|
||||
- <a href="http://forum.thelia.net/" target="_blank">{intl l='Forum Thelia'}</a>
|
||||
- <a href="http://contrib.thelia.net/" target="_blank">{intl l='Contributions Thelia'}</a>
|
||||
<span class="pull-right">{intl l='interface par <a target="_blank" href="http://www.steaw-webdesign.com/">Steaw-Webdesign</a>'}</span>
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
62
templates/install/layout.tpl
Normal file
62
templates/install/layout.tpl
Normal file
@@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{$lang_code}">
|
||||
<head>
|
||||
<title>{block name="page-title"}Thelia Install{/block}</title>
|
||||
|
||||
{images file='../admin/default/assets/img/favicon.ico'}<link rel="shortcut icon" href="{$asset_url}" />{/images}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
{stylesheets file='../admin/default/assets/less/*' filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="version-info">{intl l='Version %ver' ver="{$THELIA_VERSION}"}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* -- Main page content section ----------------------------------------- *}
|
||||
|
||||
{block name="main-content"}Put here the content of the template{/block}
|
||||
|
||||
{* -- Footer section ---------------------------------------------------- *}
|
||||
|
||||
<hr />
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<p>{intl l='© Thelia 2013'}
|
||||
- <a href="http://www.openstudio.fr/" target="_blank">{intl l='Édité par OpenStudio'}</a>
|
||||
- <a href="http://forum.thelia.net/" target="_blank">{intl l='Forum Thelia'}</a>
|
||||
- <a href="http://contrib.thelia.net/" target="_blank">{intl l='Contributions Thelia'}</a>
|
||||
<span class="pull-right">{intl l='interface par <a target="_blank" href="http://www.steaw-webdesign.com/">Steaw-Webdesign</a>'}</span>
|
||||
</p>
|
||||
|
||||
{module_include location='in_footer'}
|
||||
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{* -- Javascript section ------------------------------------------------ *}
|
||||
|
||||
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
|
||||
|
||||
{block name="after-javascript-include"}{/block}
|
||||
|
||||
{javascripts file='../admin/default/assets/js/bootstrap/bootstrap.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{block name="javascript-initialization"}{/block}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
51
templates/install/step-2.html
Normal file
51
templates/install/step-2.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{extends file="layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Installation step 2'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="install">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
|
||||
|
||||
<div class="wizard">
|
||||
<ul>
|
||||
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
|
||||
<li class="active"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="well">
|
||||
<p>We will check some rights to files and directories...</p>
|
||||
<ul class="list-unstyled list-group">
|
||||
<li class="list-group-item text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
|
||||
<li class="list-group-item text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
|
||||
<li class="list-group-item text-danger">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
|
||||
<li class="list-group-item text-danger">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
|
||||
<li class="list-group-item text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
|
||||
<li class="list-group-item text-danger">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
|
||||
<li class="list-group-item text-success">Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<a href="install" class="pull-left btn btn-default"><span class="glyphicon glyphicon-chevron-left"></span> {intl l="Return"}</a>
|
||||
<a href="install/step/3" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
56
templates/install/step-3.html
Normal file
56
templates/install/step-3.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{extends file="layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Installation step 3'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="install">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
|
||||
|
||||
<div class="wizard">
|
||||
<ul>
|
||||
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></a></li>
|
||||
<li class="active"><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="well">
|
||||
|
||||
<form action="">
|
||||
<div class="form-group">
|
||||
<label for="">{intl l="Host"} :</label>
|
||||
<input id="" type="text" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="">{intl l="Login"} :</label>
|
||||
<input id="" type="text" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="">{intl l="Password"} :</label>
|
||||
<input id="" type="password" class="form-control">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<a href="install/step/2" class="pull-left btn btn-default"><span class="glyphicon glyphicon-chevron-left"></span> {intl l="Return"}</a>
|
||||
<a href="install/step/4" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
77
templates/install/step-4.html
Normal file
77
templates/install/step-4.html
Normal file
@@ -0,0 +1,77 @@
|
||||
{extends file="layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Installation step 4'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="install">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
|
||||
|
||||
<div class="wizard">
|
||||
<ul>
|
||||
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></a></li>
|
||||
<li class="active"><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="well">
|
||||
<form action="">
|
||||
<fieldset>
|
||||
<legend>{intl l="Choose your database"}</legend>
|
||||
<p>
|
||||
The SQL server contains multiple databases.<br/>
|
||||
Select below the one you want to use.
|
||||
</p>
|
||||
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="" id="" value="">
|
||||
Database 1
|
||||
</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="" id="" value="">
|
||||
Database 2
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
{intl l="or"}
|
||||
</p>
|
||||
|
||||
<div class="radio">
|
||||
<label>
|
||||
<input type="radio" name="" id="" value="" checked>
|
||||
Create an other database
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<a href="install/step/2" class="pull-left btn btn-default"><span class="glyphicon glyphicon-chevron-left"></span> {intl l="Return"}</a>
|
||||
<a href="install/step/4" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
72
templates/install/step-5.html
Normal file
72
templates/install/step-5.html
Normal file
@@ -0,0 +1,72 @@
|
||||
{extends file="layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Installation step 4'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="install">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
|
||||
|
||||
<div class="wizard">
|
||||
<ul>
|
||||
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></a></li>
|
||||
<li class="active"><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></li>
|
||||
<li><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="well">
|
||||
<form action="">
|
||||
|
||||
<p>
|
||||
The system will now you create a custom site access.
|
||||
</p>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="">{intl l="Login"} :</label>
|
||||
<input id="" type="text" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="">{intl l="Password"} :</label>
|
||||
<input id="" type="password" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="">{intl l="Password confirmation"} :</label>
|
||||
<input id="" type="password" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="">{intl l="Email address"} :</label>
|
||||
<input id="" type="email" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="">{intl l="Email address confirmation"} :</label>
|
||||
<input id="" type="email" class="form-control">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<a href="install/step/2" class="pull-left btn btn-default"><span class="glyphicon glyphicon-chevron-left"></span> {intl l="Return"}</a>
|
||||
<a href="install/step/4" class="pull-right btn btn-default btn-primary"><span class="glyphicon glyphicon-chevron-right"></span> {intl l="Continue"}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
42
templates/install/thanks.html
Normal file
42
templates/install/thanks.html
Normal file
@@ -0,0 +1,42 @@
|
||||
{extends file="layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Thanks'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="install">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<h3 class="title title-without-tabs">{intl l="Thelia installation wizard"}</h3>
|
||||
|
||||
<div class="wizard">
|
||||
<ul>
|
||||
<li class="complete"><a href="#"><span class="badge">1</span>{intl l="Welcome"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">2</span>{intl l="Checking permissions"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">3</span>{intl l="Database connection"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">4</span>{intl l="Database selection"}<span class="chevron"></span></a></li>
|
||||
<li class="complete"><a href="#"><span class="badge">5</span>{intl l="General information"}<span class="chevron"></span></a></li>
|
||||
<li class="active"><span class="badge">6</span>{intl l="Thanks"}<span class="chevron"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="well">
|
||||
<p class="lead text-center">
|
||||
{intl l="Thank you have installed Thelia"}.
|
||||
</p>
|
||||
<p class="text-center">
|
||||
{intl l="You will be redirected to your personal space in order to manage your store now."}
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
Reference in New Issue
Block a user