Merge branch 'master' of github.com:thelia/thelia

This commit is contained in:
Manuel Raynaud
2013-10-08 09:44:47 +02:00
50 changed files with 565 additions and 11063 deletions

View File

@@ -16,6 +16,16 @@ Requirements
------------
* php 5.4
* Required extensions :
* PDO_Mysql
* mcrypt
* intl
* gd
* curl
* safe_mode off
* memory_limit at least 150M, preferably 256.
* post_max_size 20M
* upload_max_filesize 2M
* apache 2
* mysql 5

View File

@@ -60,6 +60,13 @@ class Address extends BaseAction implements EventSubscriberInterface
$address->delete();
}
public function useDefault(AddressEvent $event)
{
$address = $event->getAddress();
$address->makeItDefault();
}
protected function createOrUpdate(AddressModel $addressModel, AddressCreateOrUpdateEvent $event)
{
$addressModel->setDispatcher($this->getDispatcher());
@@ -125,7 +132,8 @@ class Address extends BaseAction implements EventSubscriberInterface
return array(
TheliaEvents::ADDRESS_CREATE => array("create", 128),
TheliaEvents::ADDRESS_UPDATE => array("update", 128),
TheliaEvents::ADDRESS_DELETE => array("delete", 128)
TheliaEvents::ADDRESS_DELETE => array("delete", 128),
TheliaEvents::ADDRESS_DEFAULT => array('useDefault', 128),
);
}
}

View File

@@ -25,6 +25,7 @@ namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\ActionEvent;
use Thelia\Core\Event\Customer\CustomerAddressEvent;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerEvent;
use Thelia\Core\Event\TheliaEvents;
@@ -148,11 +149,11 @@ class Customer extends BaseAction implements EventSubscriberInterface
public static function getSubscribedEvents()
{
return array(
TheliaEvents::CUSTOMER_CREATEACCOUNT => array("create", 128),
TheliaEvents::CUSTOMER_UPDATEACCOUNT => array("modify", 128),
TheliaEvents::CUSTOMER_LOGOUT => array("logout", 128),
TheliaEvents::CUSTOMER_LOGIN => array("login" , 128),
TheliaEvents::CUSTOMER_DELETEACCOUNT => array("delete", 128),
TheliaEvents::CUSTOMER_CREATEACCOUNT => array('create', 128),
TheliaEvents::CUSTOMER_UPDATEACCOUNT => array('modify', 128),
TheliaEvents::CUSTOMER_LOGOUT => array('logout', 128),
TheliaEvents::CUSTOMER_LOGIN => array('login', 128),
TheliaEvents::CUSTOMER_DELETEACCOUNT => array('delete', 128),
);
}
}

View File

@@ -123,6 +123,32 @@
<!-- end Customer rule management -->
<!-- address management -->
<route id="admin.address.delete" path="/admin/address/delete" methods="post">
<default key="_controller">Thelia\Controller\Admin\AddressController::deleteAction</default>
</route>
<route id="admin.address.makeItDefault" path="/admin/address/use" methods="post">
<default key="_controller">Thelia\Controller\Admin\AddressController::useAddressAction</default>
</route>
<route id="admin.address.create" path="/admin/address/create" methods="post">
<default key="_controller">Thelia\Controller\Admin\AddressController::createAction</default>
</route>
<route id="admin.address.update.view" path="/admin/address/update/{address_id}">
<default key="_controller">Thelia\Controller\Admin\AddressController::updateAction</default>
<requirement key="address_id">\d+</requirement>
</route>
<route id="admin.address.save" path="/admin/address/save/{address_id}">
<default key="_controller">Thelia\Controller\Admin\AddressController::processUpdateAction</default>
<requirement key="address_id">\d+</requirement>
</route>
<!-- end address management -->
<!-- order management -->
<route id="admin.order.list" path="/admin/orders">

View File

@@ -0,0 +1,306 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 3 of the License */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* */
/*************************************************************************************/
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\Address\AddressCreateOrUpdateEvent;
use Thelia\Core\Event\Address\AddressEvent;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\AddressCreateForm;
use Thelia\Form\AddressUpdateForm;
use Thelia\Model\AddressQuery;
use Thelia\Model\CustomerQuery;
/**
* Class AddressController
* @package Thelia\Controller\Admin
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class AddressController extends AbstractCrudController
{
public function __construct()
{
parent::__construct(
'address',
null,
null,
'admin.customer.update.view',
'admin.address.create',
'admin.address.update',
'admin.address.delete',
TheliaEvents::ADDRESS_CREATE,
TheliaEvents::ADDRESS_UPDATE,
TheliaEvents::ADDRESS_DELETE,
null,
null
);
}
public function useAddressAction()
{
if (null !== $response = $this->checkAuth("admin.customer.update")) return $response;
$address_id = $this->getRequest()->request->get('address_id');
try {
$address = AddressQuery::create()->findPk($address_id);
if (null === $address) {
throw new \InvalidArgumentException(sprintf('%d address does not exists', $address_id));
}
$addressEvent = new AddressEvent($address);
$this->dispatch(TheliaEvents::ADDRESS_DEFAULT, $addressEvent);
$this->adminLogAppend(sprintf("address %d for customer %d removal", $address_id, $address->getCustomerId()));
} catch(\Exception $e) {
\Thelia\Log\Tlog::getInstance()->error(sprintf("error during address removal with message %s", $e->getMessage()));
}
$this->redirectToRoute('admin.customer.update.view', array(), array('customer_id' => $address->getCustomerId()));
}
/**
* Return the creation form for this object
*/
protected function getCreationForm()
{
return new AddressCreateForm($this->getRequest());
}
/**
* Return the update form for this object
*/
protected function getUpdateForm()
{
return new AddressUpdateForm($this->getRequest());
}
/**
* Hydrate the update form for this object, before passing it to the update template
*
* @param \Thelia\Model\Address $object
*/
protected function hydrateObjectForm($object)
{
$data = array(
"label" => $object->getLabel(),
"title" => $object->getTitleId(),
"firstname" => $object->getFirstname(),
"lastname" => $object->getLastname(),
"address1" => $object->getAddress1(),
"address2" => $object->getAddress2(),
"address3" => $object->getAddress3(),
"zipcode" => $object->getZipcode(),
"city" => $object->getCity(),
"country" => $object->getCountryId(),
"cellphone" => $object->getCellphone(),
"phone" => $object->getPhone(),
"company" => $object->getCompany()
);
return new AddressUpdateForm($this->getRequest(), "form", $data);
}
/**
* Creates the creation event with the provided form data
*
* @param unknown $formData
*/
protected function getCreationEvent($formData)
{
$event = $this->getCreateOrUpdateEvent($formData);
$customer = CustomerQuery::create()->findPk($this->getRequest()->get("customer_id"));
$event->setCustomer($customer);
return $event;
}
/**
* Creates the update event with the provided form data
*
* @param unknown $formData
*/
protected function getUpdateEvent($formData)
{
$event = $this->getCreateOrUpdateEvent($formData);
$event->setAddress($this->getExistingObject());
return $event;
}
protected function getCreateOrUpdateEvent($formData)
{
$event = new AddressCreateOrUpdateEvent(
$formData["label"],
$formData["title"],
$formData["firstname"],
$formData["lastname"],
$formData["address1"],
$formData["address2"],
$formData["address3"],
$formData["zipcode"],
$formData["city"],
$formData["country"],
$formData["cellphone"],
$formData["phone"],
$formData["company"],
$formData["is_default"]
);
return $event;
}
/**
* Creates the delete event with the provided form data
*/
protected function getDeleteEvent()
{
return new AddressEvent($this->getExistingObject());
}
/**
* Return true if the event contains the object, e.g. the action has updated the object in the event.
*
* @param unknown $event
*/
protected function eventContainsObject($event)
{
return null !== $event->getAddress();
}
/**
* Get the created object from an event.
*
* @param unknown $createEvent
*/
protected function getObjectFromEvent($event)
{
return null;
}
/**
* Load an existing object from the database
*/
protected function getExistingObject()
{
return AddressQuery::create()->findPk($this->getRequest()->get('address_id'));
}
/**
* Returns the object label form the object event (name, title, etc.)
*
* @param unknown $object
*/
protected function getObjectLabel($object)
{
return $object->getLabel();
}
/**
* Returns the object ID from the object
*
* @param unknown $object
*/
protected function getObjectId($object)
{
return $object->getId();
}
/**
* Render the main list template
*
* @param unknown $currentOrder, if any, null otherwise.
*/
protected function renderListTemplate($currentOrder)
{
// TODO: Implement renderListTemplate() method.
}
/**
* Render the edition template
*/
protected function renderEditionTemplate()
{
return $this->render('ajax/address-update-modal', array(
"address_id" => $this->getRequest()->get('address_id'),
"customer_id" => $this->getExistingObject()->getCustomerId()
));
}
/**
* Redirect to the edition template
*/
protected function redirectToEditionTemplate()
{
$address = $this->getExistingObject();
$this->redirectToRoute('admin.customer.update.view', array(), array('customer_id' => $address->getCustomerId()));
}
/**
* Redirect to the list template
*/
protected function redirectToListTemplate()
{
// TODO: Implement redirectToListTemplate() method.
}
/**
* Put in this method post object delete processing if required.
*
* @param \Thelia\Core\Event\AddressEvent $deleteEvent the delete event
* @return Response a response, or null to continue normal processing
*/
protected function performAdditionalDeleteAction($deleteEvent)
{
$address = $deleteEvent->getAddress();
$this->redirectToRoute('admin.customer.update.view', array(), array('customer_id' => $address->getCustomerId()));
}
/**
* Put in this method post object creation processing if required.
*
* @param AddressCreateOrUpdateEvent $createEvent the create event
* @return Response a response, or null to continue normal processing
*/
protected function performAdditionalCreateAction($createEvent)
{
$this->redirectToEditionTemplate();
}
protected function performAdditionalUpdateAction($event)
{
$this->redirectToEditionTemplate();
}
}

View File

@@ -51,7 +51,7 @@ class BaseAdminController extends BaseController
/**
* Helper to append a message to the admin log.
*
* @param unknown $message
* @param string $message
*/
public function adminLogAppend($message)
{
@@ -246,9 +246,9 @@ class BaseAdminController extends BaseController
* @param unknown $routeId the route ID, as found in Config/Resources/routing/admin.xml
* @param unknown $urlParameters the URL parametrs, as a var/value pair array
*/
public function redirectToRoute($routeId, $urlParameters = array())
public function redirectToRoute($routeId, $urlParameters = array(), $routeParameters = array())
{
$this->redirect(URL::getInstance()->absoluteUrl($this->getRoute($routeId), $urlParameters));
$this->redirect(URL::getInstance()->absoluteUrl($this->getRoute($routeId, $routeParameters), $urlParameters));
}
/**

View File

@@ -22,13 +22,17 @@
/*************************************************************************************/
namespace Thelia\Controller\Admin;
use Propel\Runtime\Exception\PropelException;
use Symfony\Component\Form\Form;
use Thelia\Core\Event\Address\AddressEvent;
use Thelia\Core\Event\Customer\CustomerAddressEvent;
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
use Thelia\Core\Event\Customer\CustomerEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\CustomerModification;
use Thelia\Form\Exception\FormValidationException;
use Thelia\Model\AddressQuery;
use Thelia\Model\CustomerQuery;
use Thelia\Core\Translation\Translator;
@@ -53,6 +57,8 @@ class CustomerController extends BaseAdminController
));
}
/**
* update customer action
*

View File

@@ -76,6 +76,11 @@ final class TheliaEvents
*/
const CUSTOMER_DELETEACCOUNT = "action.deleteCustomer";
/**
* sent on customer address removal
*/
const CUSTOMER_ADDRESS_DELETE = "action.customer.deleteAddress";
/**
* sent when a customer need a new password
*/
@@ -134,6 +139,11 @@ final class TheliaEvents
*/
const ADDRESS_DELETE = "action.deleteAddress";
/**
* sent when an address is tag as default
*/
const ADDRESS_DEFAULT = "action.defaultAddress";
const BEFORE_CREATEADDRESS = "action.before_createAddress";
const AFTER_CREATEADDRESS = "action.after_createAddress";

View File

@@ -40,21 +40,33 @@ class Database
/**
* Insert all sql needed in database
* Default insert /install/thelia.sql and /install/insert.sql
*
* @param $dbName
* @param string $dbName Database name
* @param array $extraSqlFiles SQL Files uri to insert
*/
public function insertSql($dbName = null)
public function insertSql($dbName = null, array $extraSqlFiles = null)
{
if($dbName) {
if ($dbName) {
$this->connection->query(sprintf("use %s", $dbName));
}
$sql = array();
$sql = array_merge(
$sql,
$this->prepareSql(file_get_contents(THELIA_ROOT . "/install/thelia.sql")),
$this->prepareSql(file_get_contents(THELIA_ROOT . "/install/insert.sql"))
);
if (null === $extraSqlFiles) {
$sql = array_merge(
$sql,
$this->prepareSql(file_get_contents(THELIA_ROOT . '/install/thelia.sql')),
$this->prepareSql(file_get_contents(THELIA_ROOT . '/install/insert.sql'))
);
} else {
foreach ($extraSqlFiles as $fileToInsert) {
$sql = array_merge(
$sql,
$this->prepareSql(file_get_contents($fileToInsert))
);
}
}
for ($i = 0; $i < count($sql); $i ++) {
if (!empty($sql[$i])) {
@@ -75,7 +87,7 @@ class Database
$sql = trim($sql);
$query = array();
$tab = explode(";", $sql);
$tab = explode(";\n", $sql);
for ($i=0; $i<count($tab); $i++) {
$queryTemp = str_replace("-CODE-", ";',", $tab[$i]);

View File

@@ -0,0 +1,111 @@
{* Update an Address *}
{form name="thelia.address.update"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "edit_address_dialog"}
{form_hidden_fields form=$form}
{form_field form=$form field='label'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label} }" placeholder="{intl l='Label'}">
</div>
{/form_field}
{form_field form=$form field='company'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Company'}">
</div>
{/form_field}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="title" name="title1"}
<option value="{$ID}" {if $value == $ID}selected{/if}>{$LONG}</option>
{/loop}
</select>
</div>
{/form_field}
{form_field form=$form field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Firstname'}">
</div>
{/form_field}
{form_field form=$form field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Lastname'}">
</div>
{/form_field}
{form_field form=$form field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Address'}">
</div>
<div class="form-group">
{form_field form=$form field='address2'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
<div class="form-group">
{form_field form=$form field='address3'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
{/form_field}
{form_field form=$form field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='Zip code'}">
</div>
{/form_field}
{form_field form=$form field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l={$label}}" placeholder="{intl l='City'}">
</div>
{/form_field}
{form_field form=$form field='country'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l={$label}} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="country" name="country1"}
<option value="{$ID}" {if $value == $ID}selected{/if}>{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "edit_address_dialog"
dialog_title = {intl l="Edit an address"}
dialog_body = {$smarty.capture.edit_address_dialog nofilter}
dialog_ok_label = {intl l="Edit this address"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path="/admin/address/save/{$address_id}"}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}

View File

@@ -295,6 +295,13 @@
width: auto;
}
.modal-backdrop .loading {
left: 50%;
top: 50%;
right: auto;
position: absolute;
}
.existing-image .col-sm-6{
position: relative;

View File

@@ -44,7 +44,7 @@
{/form_field}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
{loop name="address" type="address" customer="$customer_id" backend_context="1" default="true"}
<div class="col-md-6">
<p class="title title-without-tabs">{intl l="Customer informations"}</p>
@@ -74,7 +74,7 @@
</div>
{/form_field}
{loop name="address" type="address" customer="$customer_id" backend_context="1" default="true"}
<p class="title title-without-tabs">{intl l="Default address"}</p>
@@ -171,15 +171,15 @@
<td>
<div class="btn-group">
<a class="btn btn-default btn-xs" title="{intl l='Edit this address'}" href="#edit_address_dialog" data-toggle="modal">
<a class="btn btn-default btn-xs customer-update-address" title="{intl l='Edit this address'}" href="#" data-id="{$ID}">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="btn btn-default btn-xs" title="{intl l='Use this address by default'}" href="#use_address_dialog" data-toggle="modal" rel="tooltip">
<a class="btn btn-default btn-xs customer-address-use" title="{intl l='Use this address by default'}" href="#use_address_dialog" data-id="{$ID}" data-toggle="modal" rel="tooltip">
<span class="glyphicon glyphicon-pushpin"></span>
</a>
<a class="btn btn-default btn-xs customer-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_address_dialog" data-id="{$ID}" data-toggle="modal">
<a class="btn btn-default btn-xs customer-address-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_address_dialog" data-id="{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
@@ -218,7 +218,7 @@
</div>
</div>
<div id="address-update-modal"></div>
{* Add an Address *}
{form name="thelia.address.create"}
@@ -227,7 +227,10 @@
{capture "address_creation_dialog"}
{form_hidden_fields form=$form}
<input type="hidden" name="customer_id" value="{$customer_id}">
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path="/admin/customer/update/{$customer_id}"}" />
{/form_field}
{form_field form=$form field='label'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
@@ -246,7 +249,7 @@
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
<select name="{$name}" id="{$label_attr.for}" class="form-control" required>
{loop type="title" name="title1"}
<option value="{$ID}">{$LONG}</option>
{/loop}
@@ -257,21 +260,21 @@
{form_field form=$form field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Firstname'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Firstname'}" required>
</div>
{/form_field}
{form_field form=$form field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Lastname'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Lastname'}" required>
</div>
{/form_field}
{form_field form=$form field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Address'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Address'}" required>
</div>
<div class="form-group">
@@ -290,21 +293,21 @@
{form_field form=$form field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Zip code'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Zip code'}" required>
</div>
{/form_field}
{form_field form=$form field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='City'}">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='City'}" required>
</div>
{/form_field}
{form_field form=$form field='country'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
<select name="{$name}" id="{$label_attr.for}" class="form-control" required>
{loop type="country" name="country1"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
@@ -331,117 +334,7 @@
{/form}
{* Update an Address *}
{form name="thelia.address.update"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "edit_address_dialog"}
{form_hidden_fields form=$form}
{form_field form=$form field='label'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Label'}">
</div>
{/form_field}
{form_field form=$form field='company'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Company'}">
</div>
{/form_field}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="title" name="title1"}
<option value="{$ID}">{$LONG}</option>
{/loop}
</select>
</div>
{/form_field}
{form_field form=$form field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Firstname'}">
</div>
{/form_field}
{form_field form=$form field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Lastname'}">
</div>
{/form_field}
{form_field form=$form field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Address'}">
</div>
<div class="form-group">
{form_field form=$form field='address2'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
<div class="form-group">
{form_field form=$form field='address3'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
{/form_field}
{form_field form=$form field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Zip code'}">
</div>
{/form_field}
{form_field form=$form field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='City'}">
</div>
{/form_field}
{form_field form=$form field='country'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="country" name="country1"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "edit_address_dialog"
dialog_title = {intl l="Edit an address"}
dialog_body = {$smarty.capture.edit_address_dialog nofilter}
dialog_ok_label = {intl l="Edit this address"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path='/admin/address/update'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}
{* Default confirmation dialog *}
@@ -475,7 +368,7 @@
dialog_message = {intl l="Do you really want to delete this address ?"}
form_action = {url path='/admin/address/delete'}
form_content = {$smarty.capture.delete_dialog nofilter}
form_content = {$smarty.capture.delete_address_dialog nofilter}
}
{/block}
@@ -483,4 +376,35 @@
{javascripts file='assets/js/main.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script>
(function($) {
$(document).ready(function(){
$("a.customer-address-delete").click(function(e){
$("#address_delete_id").val($(this).data("id"));
});
$("a.customer-address-use").click(function(e){
$("#address_use_id").val($(this).data("id"));
});
$("a.customer-update-address").click(function(e){
var baseUrl = "{url path="/admin/address/update/"}";
$('body').append('<div class="modal-backdrop fade in" id="loading-event"><div class="loading"></div></div>');
$.ajax({
method: 'get',
url: baseUrl+$(this).data('id')
}).done(function(data){
$("#loading-event").remove();
$("#address-update-modal").html(data);
$("#edit_address_dialog").modal("show");
});
});
$(document).on("hidden.bs.modal", "#edit_address_dialog", function(ev){
$("#edit_address_dialog").remove();
});
});
})(jQuery);
</script>
{/block}

View File

@@ -62,24 +62,6 @@ URL: http://www.thelia.net
<nav class="navbar-collapse collapse nav-main" role="navigation" aria-label="Main Navigation">
<ul class="nav navbar-nav navbar-categories">
<li class="active"><a href="{url path="/"}" class="home" tabindex="-1">Home</a></li>
{* <li class="dropdown">
<a href="" data-toggle="dropdown" class="dropdown-toggle">Pages</a>
<ul class="dropdown-menu list-subnav" role="menu">
<li class="active"><a href="index.html" tabindex="-1">Index</a></li>
<li><a href="category.html">Category Grid</a></li>
<li><a href="category-list.html">Category List</a></li>
<li><a href="account.html">Account</a></li>
<li><a href="login.html">Login</a></li>
<li><a href="password.html">Forgot Password</a></li>
<li><a href="register.html">Register</a></li>
<li><a href="cart.html">Cart</a></li>
<li><a href="cart-step2.html">Cart (Step 2)</a></li>
<li><a href="cart-step3.html">Cart (Step 3)</a></li>
<li><a href="cart-step4.html">Cart (Step 4)</a></li>
<li><a href="product-details.html">Product details</a></li>
<li><a href="address.html">New address</a></li>
</ul>
</li>*}
{loop type="category" name="category.navigation" parent="0"}
<li><a href="{$URL}">{$TITLE}</a></li>
{/loop}

View File

@@ -26,7 +26,7 @@
<meta itemprop="brand" content="{$TITLE}">
{/loop}
{/loop}
{loop name="brand.feature" type="feature" product=$ID title="isbn"}
{loop name="isbn.feature" type="feature" product=$ID title="isbn"}
{loop name="brand.value" type="feature_value" feature=$ID product=$product_id}
<meta itemprop="productID" content="isbn:{$TITLE}">
{/loop}

View File

@@ -1,3 +0,0 @@
<h1>PAGE NOT FOUND</h1>
<a href="{navigate to="index"}">Back Home</a>

View File

@@ -1,99 +0,0 @@
{check_auth context="front" roles="CUSTOMER" login_tpl="login"}
{include file="includes/header.html"}
{$page_title="{intl l='My Account'}"}
{form name="thelia.address.create"}
{if $form_error}<div class="alert alert-block alert-error">{$form_error_message}</div>{/if}
{* We use {navigate to="index"} as form action to avoid mixing post and get data *}
<form action="{url path="/address/create" }" method="post" {form_enctype form=$form}>
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{viewurl view="address_list"}" />
{/form_field}
{form_hidden_fields form=$form}
{form_field form=$form field="label"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="title"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<select name="{$name}">
{loop type="title" name="title1"}
<option value="{$ID}">{$LONG}</option>
{/loop}
</select>
<br />
{/form_field}
{form_field form=$form field="firstname"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="lastname"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="address1"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="zipcode"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="city"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="country"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<select name="{$name}">
{loop type="country" name="country1"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
<br />
{/form_field}
{form_field form=$form field="phone"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
<input type="submit" value="submit">
</form>
{/form}
{include file="includes/footer.html"}

View File

@@ -1,100 +0,0 @@
{check_auth context="front" roles="CUSTOMER" login_tpl="login"}
{include file="includes/header.html"}
{$page_title="{intl l='My Account'}"}
{form name="thelia.address.update"}
{if $form_error}<div class="alert alert-block alert-error">{$form_error_message}</div>{/if}
{* We use {navigate to="index"} as form action to avoid mixing post and get data *}
<form action="{url path="/address/update" }" method="post" {form_enctype form=$form}>
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{viewurl view="address_list"}" />
{/form_field}
<input type="hidden" name="address_id" value="5" />
{form_hidden_fields form=$form}
{form_field form=$form field="label"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="title"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<select name="{$name}">
{loop type="title" name="title1"}
<option value="{$ID}">{$LONG}</option>
{/loop}
</select>
<br />
{/form_field}
{form_field form=$form field="firstname"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="lastname"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="address1"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="zipcode"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="city"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
{form_field form=$form field="country"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<select name="{$name}">
{loop type="country" name="country1"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
<br />
{/form_field}
{form_field form=$form field="phone"}
{if $error}{$message}{/if}
<label> <span>{intl l="{$label}"} : </span></label>
<input type="text" name="{$name}" value="{$value}" {$attr}>
<br />
{/form_field}
<input type="submit" value="submit">
</form>
{/form}
{include file="includes/footer.html"}

View File

@@ -1,11 +0,0 @@
{check_auth context="front" roles="CUSTOMER" login_tpl="login"}
{include file="includes/header.html"}
{$page_title="{intl l='My Account'}"}
<ul>
{loop type="address" name="customer_list" customer="current"}
<li>{$LABEL} - {$FIRSTNAME} {$LASTNAME} - <a href="{url path="/address/edit/{$ID}"}">edit</a></li>
{/loop}
</ul>
{include file="includes/footer.html"}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -1,9 +0,0 @@
body {
font-size: 12px;
font-family: Arial, helvetica, sans serif;
background-image: url("../img/test-background.jpg");
}
div {
margin: 10px 0;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

File diff suppressed because one or more lines are too long

View File

@@ -1,50 +0,0 @@
{include file="includes/header.html"}
<h1>{intl l='cart'}</h1>
<ul>
{loop name="cart" type="cart"}
<li>Item {$LOOP_COUNT}/{$LOOP_TOTAL} : {$ITEM_ID} {$TITLE} - quantity : {$QUANTITY}</li>
{/loop}
</ul>
{form name="thelia.cart.add" }
{* We use {navigate to="index"} as form action to avoid mixing post and get data *}
<form action="{url path="/cart/add" }" method="post" {form_enctype form=$form}>
{*
The form error status and the form error messages are defined in Customer action,
and passed back to the form plugin through the ParserContext.
*}
{if $form_error}<div class="alert alert-error">{$form_error_message}</div>{/if}
{form_hidden_fields form=$form}
{form_field form=$form field="product"}
{form_error form=$form field="product"}
{$message}
{/form_error}
<label for="{$label_attr.for}">{intl l="{$label}"}: </label><input id="{$label_attr.for}" type="text" name="{$name}" value="{$value}" {$attr} ><br />
{/form_field}
{form_field form=$form field='product_sale_elements_id'}
{form_error form=$form field="product_sale_elements_id"}
{$message}
{/form_error}
<label>{intl l="product_sale_elements_id"}: </label><input type="text" name="{$name}" value="{$value}" {$attr}> <br />
{/form_field}
{form_field form=$form field='quantity'}
{form_error form=$form field="quantity"}
{$message}
{/form_error}
<label>{intl l="quantity"}: </label><input type="text" name="{$name}" value="{$value}" {$attr}> <br />
{/form_field}
<button type="submit">{intl l='Login'}</button>
</form>
{/form}
{include file='includes/footer.html'}

View File

@@ -1,145 +0,0 @@
<h1>Category page</h1>
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 45%; float: left">
<h2>CATALOG</h2>
{loop name="category0" type="category" parent="0" order="manual"}
<div style="border: solid 4px blue; padding: 20px; margin: 10px;">
<h2>CATEGORY : {$TITLE} ({$LOOP_COUNT} / {$LOOP_TOTAL})</h2>
{ifloop rel="prod_ass_cont"}
<h5>Associated Content</h5>
<ul>
{loop name="prod_ass_cont" type="associated_content" category="$ID" order="associated_content"}
<li>{$TITLE}</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="prod_ass_cont"}
<h5>No associated content</h5>
{/elseloop}
{loop name="product" type="product" category="$ID"}
<div style="border: dashed 2px red; padding: 20px; margin: 10px;">
<h3><a href="{$URL}">PRODUCT {$ID} : {$REF} ({$LOOP_COUNT} / {$LOOP_TOTA}L)</a></h3>
<h4>{$TITLE}</h4>
<p>{$DESCRIPTION}</p>
<p>Starting by {$BEST_PRICE} € HT (TAX : {$BEST_PRICE_TAX} ; {$BEST_TAXED_PRICE} € TTC)</p>
{ifloop rel="ft"}
<h5>Features</h5>
<ul>
{assign var=current_product value=$ID}
{loop name="ft" type="feature" order="manual" product="$ID"}
<li>
<strong>{$TITLE}</strong> :
{loop name="ft_v" type="feature_value" product="{$current_product}" feature="{$ID}"}
{$TITLE} / {$PERSONAL_VALUE}
{/loop}
</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="ft"}
<h5>No feature</h5>
{/elseloop}
</div>
{/loop}
{loop name="catgory1" type="category" parent="$ID"}
<div style="border: double 4px lightseagreen; padding: 20px; margin: 10px;">
<h3>SUBCATEGORY : {$TITLE} ({$LOOP_COUNT} / {$LOOP_TOTAL})</h3>
{ifloop rel="prod_ass_cont"}
<h5>Associated Content</h5>
<ul>
{loop name="prod_ass_cont" type="associated_content" category="$ID" order="associated_content"}
<li>{$TITLE}</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="prod_ass_cont"}
<h5>No associated content</h5>
{/elseloop}
{loop name="product" type="product" category="$ID"}
<div style="border: solid 1px green; padding: 20px; margin: 10px;">
<h3><a href="{$URL}">PRODUCT {$ID} : {$REF} ({$LOOP_COUNT} / {$LOOP_TOTAL})</a></h3>
<h4>{$TITLE}</h4>
<p>{$DESCRIPTION}</p>
{ifloop rel="ft"}
<h5>Features</h5>
<ul>
{assign var=current_product value=$ID}
{loop name="ft" type="feature" order="manual" product="$ID"}
<li>
<strong>{$TITLE}</strong> :
{loop name="ft_v" type="feature_value" product="{$current_product}" feature="$ID"}
{$TITLE} / {$PERSONAL_VALUE}
{/loop}
</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="ft"}
<h5>No feature</h5>
{/elseloop}
</div>
{/loop}
</div>
{/loop}
</div>
{/loop}
</div>
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 45%; float: left">
<h2>ALL FEATURES AND THEIR AVAILABILITY</h2>
<ul>
{loop name="ft" type="feature" order="manual"}
<li>
{$TITLE}
<ul>
{loop name="ftav" type="feature_availability" order="manual" feature="$ID"}
<li>{$TITLE}</li>
{/loop}
</ul>
</li>
{/loop}
</ul>
<hr />
<h2>ALL ATTRIBUTES AND THEIR AVAILABILITY</h2>
<ul>
{loop name="attr" type="attribute" order="manual"}
<li>
{$TITLE}
<ul>
{loop name="attrav" type="attribute_availability" order="manual" attribute="$ID"}
<li>{$TITLE}</li>
{/loop}
</ul>
</li>
{/loop}
</ul>
<hr />
<h2>CURRENCIES</h2>
<ul>
{loop name="cur" type="currency"}
<li>
{$NAME} ({$SYMBOL})
</li>
{/loop}
</ul>
</div>

View File

@@ -1,165 +0,0 @@
{include file="includes/header.html"}
{form name="thelia.customer.creation"}
{* We use {navigate to="index"} as form action to avoid mixing post and get data *}
<form action="{url path="/customer/create" }" method="post" {form_enctype form=$form}>
{*
The two fields below are not par of the form, they are here to defines
the action to process, and the view to render once the form is submited
*}
{*
This field is common to all BaseForm instances (thus, this one), and defines
the URL the customer is redirected to once the form has been successfully
processed
*}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{navigate to="return_to"}" /> {* the url the user is redirected to on login success *}
{/form_field}
{form_field form=$form field='auto_login'}
<input type="hidden" name="{$name}" value="1" /> {* the customer will be loogged-in automatically *}
{/form_field}
{*
The form error status and the form error messages are defined in Customer action,
and passed back to the form plugin through the ParserContext.
*}
{if $form_error}<div class="alert alert-error">{$form_error_message}</div>{/if}
{form_hidden_fields form=$form}
{form_field form=$form field="title"}
{form_error form=$form field="title"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label>
<select name="{$name}">
<option value="1">M.</option>
<option value="2">Mme.</option>
</select>
<br />
{/form_field}
{form_field form=$form field="firstname"}
{form_error form=$form field="firstname"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form field="lastname"}
{form_error form=$form field="lastname"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form field="address1"}
{form_error form=$form field="address1"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form field="address2"}
{form_error form=$form field="address2"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form field="address3"}
{form_error form=$form field="address3"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form field="zipcode"}
{form_error form=$form field="zipcode"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form field="city"}
{form_error form=$form field="city"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form field="country"}
{form_error form=$form field="country"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label>
<select name="{$name}">
<option value="1">France</option>
<option value="2">Belgium</option>
</select>
<br />
{/form_field}
{form_field form=$form field="phone"}
{form_error form=$form field="phone"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr}> <br />
{/form_field}
{form_field form=$form field="cellphone"}
{form_error form=$form field="cellphone"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr}> <br />
{/form_field}
{form_field form=$form field="email"}
{form_error form=$form field="email"}
{$message}
{/form_error}
<label><span>{intl l="{$label}"}</span></label><input type="email" name="{$name}" value="{$value}" {$attr} ><br />
{/form_field}
{form_field form=$form field="email_confirm"}
{form_error form=$form field="email_confirm"}
{$message}
{/form_error}
<label><span>{intl l="{$label}"}</span></label><input type="email" name="{$name}" {$attr} ><br />
{/form_field}
{form_field form=$form field="password"}
{form_error form=$form field="password"}
{$message}
{/form_error}
<label><span>{intl l="{$label}"}</span></label><input type="password" name="{$name}" {$attr} ><br />
{/form_field}
{form_field form=$form field="password_confirm"}
{form_error form=$form field="password_confirm"}
{$message}
{/form_error}
<label><span>{intl l="{$label}"}</span></label><input type="password" name="{$name}" {$attr} ><br />
{/form_field}
<input type="submit" value="valider">
</form>
{/form}
{include file="includes/footer.html"}

View File

@@ -1,125 +0,0 @@
<h1>CUSTOMER</h1>
<h2>Information</h2>
{loop name="customer" type="customer"}
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<td>ID</td>
<td>{$ID}</td>
</tr>
<tr>
<td>Réference</td>
<td>{$REF}</td>
</tr>
<tr>
<td>Title</td>
<td>
{loop name="title" type="title" id="$TITLE"}
{$LONG} ({$SHORT})
{/loop}
</td>
</tr>
<tr>
<td>Firstname</td>
<td>{$FIRSTNAME}</td>
</tr>
<tr>
<td>Lastname</td>
<td>{$LASTNAME}</td>
</tr>
<tr>
<td>Email</td>
<td>{$EMAIL}</td>
</tr>
<tr>
<td>Is reseller</td>
<td>{$RESELLER}</td>
</tr>
<tr>
<td>Sponsor</td>
<td>{$SPONSOR}</td>
</tr>
<tr>
<td>Discount</td>
<td>{$DISCOUNT} %</td>
</tr>
</table>
{/loop}
<h2>Addresses</h2>
{loop name="addresses" type="address"}
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<td>ID</td>
<td>{$ID}</td>
</tr>
<tr>
<td>Name</td>
<td>{$NAME}</td>
</tr>
<tr>
<td>Title</td>
<td>
<ul>
{assign var=current_title value=$TITLE}
{loop name="title" type="title"}
<li {if $current_title==$ID}style="background-color: yellow"{/if}>
{$LONG} ({$SHORT})
</li>
{/loop}
</ul>
</td>
</tr>
<tr>
<td>Company</td>
<td>{$COMPANY}</td>
</tr>
<tr>
<td>Firstname</td>
<td>{$FIRSTNAME}</td>
</tr>
<tr>
<td>Lastname</td>
<td>{$LASTNAME}</td>
</tr>
<tr>
<td>Address</td>
<td>{$ADDRESS1}<br/>{$ADDRESS2}<br/>{$ADDRESS3}</td>
</tr>
<tr>
<td>Zipcode</td>
<td>{$ZIPCODE}</td>
</tr>
<tr>
<td>City</td>
<td>{$CITY}</td>
</tr>
<tr>
<td>Country</td>
<td>
<select>
{assign var=current_country value=$COUNTRY}
{loop name="country" type="country"}
<option {if $current_country==$ID}selected="selected"{/if}>
{$TITLE} ({$ID} - {$ISOCODE} - {$ISOALPHA2} - {$ISOALPHA3})
</option>
{/loop}
</select>
</td>
</tr>
<tr>
<td>Phone</td>
<td>{$PHONE}</td>
</tr>
<tr>
<td>Cellphone</td>
<td>{$CELLPHONE}</td>
</tr>
</table>
{/loop}

View File

@@ -1,8 +0,0 @@
<h1>Category page</h1>
{loop type="category" name="categoryloop" id="500"}
TOTO
{/loop}
{pageloop rel="categoryloop"}
{/pageloop}

View File

@@ -1,15 +0,0 @@
{include file="includes/header.html"}
<ul>
{loop type="delivery" name="delivery.list"}
<li>
<ul>
<li>id : {$ID}</li>
<li>prix : {$PRICE}</li>
<li>Choisir : <a href="{url path="/delivery/choose/{$ID}"}">Choisir</a></li>
</ul>
</li>
{/loop}
</ul>
{include file="includes/footer.html"}

View File

@@ -1,16 +0,0 @@
{loop name="folder0" type="folder" parent="0" order="alpha_reverse"}
<div style="border: solid 4px blue; padding: 20px; margin: 10px;">
<h2>FOLDER : {$TITLE}</h2>
{loop name="folder1" type="folder" parent="$ID"}
<div style="border: double 4px lightseagreen; padding: 20px; margin: 10px;">
<h3>SUBFOLDER : {$TITLE} ({$LOOP_COUNT} / {$LOOP_TOTAL})</h3>
{loop name="content" type="content" folder="$ID"}
<div style="border: solid 1px green; padding: 20px; margin: 10px;">
<h3>CONTENT : {$TITLE}</h3>
<p>{$DESCRIPTION}</p>
</div>
{/loop}
</div>
{/loop}
</div>
{/loop}

View File

@@ -1 +0,0 @@
<?php

View File

@@ -1,104 +0,0 @@
{include file="includes/header.html"}
<div>
<h2>Category Images</h2>
<ul>
{loop type="category" name="jsvdfk"}
<li><p>Category id {$ID}: {$TITLE}</p>
<ul>
<li>
{loop type="image" name="image_test" category="$ID" width="200" height="100" resize_mode="borders"}
<p>Processed file URL: {$IMAGE_URL}</p>
<p>Original file URL: {$ORIGINAL_IMAGE_URL}</p>
<img src="{$IMAGE_URL}" />
{/loop}
{loop type="image" name="image_test" category="$ID"}
<p>Full size file URL: {$IMAGE_URL}</p>
<img src="{$IMAGE_URL}" />
{/loop}
{loop type="image" name="image_test" source="category" source_id="$ID"}
<p>source="category" source_id="x" argument style: Processed file URL: {$IMAGE_URL}</p>
{/loop}
</li>
</ul>
</li>
{/loop}
</ul>
</div>
<div>
<h2>Product Images</h2>
<ul>
{loop type="product" name="jsvdfk"}
<li><p>Product id {$ID}: {$TITLE}</p>
<ul>
<li>
{loop type="image" name="image_test" product="$ID" width="200" height="100" resize_mode="borders" effects="gamma:0.7" background_color="#cc8000"}
<p>Processed file URL: {$IMAGE_URL}</p>
<p>Original file URL: {$ORIGINAL_IMAGE_URL}</p>
<p>Images:</p>
<img src="{$IMAGE_URL}" />
{/loop}
{loop type="image" name="image_test" product="$ID" width="200" height="100" resize_mode="crop"}
<img src="{$IMAGE_URL}" />
{/loop}
{loop type="image" name="image_test" product="$ID" width="100" height="200" resize_mode="borders" background_color="#cc8000"}
<img src="{$IMAGE_URL}" />
{/loop}
{loop type="image" name="image_test" product="$ID" width="100" rotation="-20" background_color="#facabe"}
<img src="{$IMAGE_URL}" />
{/loop}
{loop type="image" name="image_test" product="$ID" width="200" height="100" resize_mode="borders" background_color="#facabe" effects="negative"}
<img src="{$IMAGE_URL}" />
{/loop}
</p>
</li>
</ul></li>
{/loop}
</ul>
</div>
<div>
<h2>Folder Images</h2>
<ul>
{loop type="folder" name="jsvdfk"}
<li><p>Folder id {$ID}: {$TITLE}</p>
<ul>
<li>
{loop type="image" name="image_test" folder="$ID" width="200" height="100" resize_mode="borders"}
<p>Processed file URL: {$IMAGE_URL}</p>
<p>Original file URL: {$ORIGINAL_IMAGE_URL}</p>
<img src="{$IMAGE_URL}" />
{/loop}
</li>
</ul>
</li>
{/loop}
</ul>
</div>
<div>
<h2>Content Images</h2>
<ul>
{loop type="content" name="jsvdfk"}
<li><p>Content id {$ID}: {$TITLE}</p>
<ul>
<li>
{loop type="image" name="image_test" content="$ID" width="200" height="100" resize_mode="borders"}
<p>Processed file URL: {$IMAGE_URL}</p>
<p>Original file URL: {$ORIGINAL_IMAGE_URL}</p>
<img src="{$IMAGE_URL}" />
{/loop}
</li>
</ul>
</li>
{/loop}
</ul>
</div>
{include file="includes/footer.html"}

View File

@@ -1,12 +0,0 @@
{loop name="included0" type="category" parent="0"}
<h2>Out before - CATEGORY : {$TITLE} ({$LOOP_COUNT} / {$LOOP_TOTAL})</h2>
{loop name="category1" type="category" parent="$ID"}
<h3>Inner - SUBCATEGORY : {$TITLE} ({$LOOP_COUNT} / {$LOOP_TOTAL})</h3>
{/loop}
{loop name="category2" type="category" parent="$ID"}
<h3>Inner 2 - SUBCATEGORY : {$TITLE} ({$LOOP_COUNT} / {$LOOP_TOTAL})</h3>
{/loop}
<h2>Out after - CATEGORY : {$TITLE} ({$LOOP_COUNT} / {$LOOP_TOTAL})</h2>
<hr />
{/loop}

View File

@@ -1,19 +0,0 @@
{* Include required JS files *}
{javascripts file='../assets/js/*'}
<script src="{$asset_url}"></script>
{/javascripts}
<script>
$(function() {
$('#jquery_block').html("Jquery is now loaded.").hover(function() {
$(this).css('font-weight', 'bold');
}, function() {
$(this).css('font-weight', 'normal');
});
});
</script>
{debugbar_renderjs}
{debugbar_renderresult}
</body>
</html>

View File

@@ -1,26 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>{$page_title|default:{intl l="Thelia II"}}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
{stylesheets file='../assets/css/*' filters='less,cssembed'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
{debugbar_rendercss}
</head>
<body>
<div>
{loop type="auth" name="customer_info_block" roles="CUSTOMER" context="front"}
<p>Your are logged in as {customer attr="firstname"} {customer attr="lastname"} ! <a href="{url path='/customer/logout'}">Logout</a></p>
{/loop}
{loop type="auth" name="admin_info_block" roles="ADMIN" context="admin"}
<p>You are logged as administrator {admin attr="firstname"} {admin attr="lastname"}</p>
{/loop}
{elseloop rel="customer_info_block"}
You are not logged in. <a href="{viewurl view='login'}">Login now</a> or <a href="{viewurl view='connexion'}">create your account</a>
{/elseloop}
</div>
<hr />

View File

@@ -1,153 +0,0 @@
{include file="includes/header.html"}
<div>
Here you are : {navigate to="current"}
{loop type="auth" name="auth_test" context="front" roles="CUSTOMER"}
<p>Customer is authentified :-)</p>
{/loop}
{elseloop rel="auth_test"}
<p>Customer is not authentified :-(</p>
{/elseloop}
An image from asset directory :
{images file='assets/img/logo-thelia-34px.png'}<img src="{$asset_url}" alt="{intl l='Thelia, solution e-commerce libre'}" />{/images}
</div>
<div>
{intl l='An internationalized string'}
</div>
<div>
jQuery data: <span id="jquery_block"></span>
</div>
<div>
<p>Category loop example</p>
<ul>
{loop type="category" name="catloop1"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}, children: {$NB_CHILD}
{ifloop rel="inner1"}
<ul>
{loop type="category" name="inner1" parent="{$ID}"}
<li>Sub cat {$ID} (parent is {$PARENT}): {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
</li>
{/loop}
</ul>
</div>
<div>
<p>Conditional example #1</p>
{ifloop rel="catloop2"}
Hey ! Loop catloop2 is not empty:
<ul>
{loop type="category" name="catloop2" parent="12"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="catloop2"}
<p>Loop catloop2 is empty</p>
{/elseloop}
</div>
<div>
<p>Conditional example #2</p>
{ifloop rel="catloop3"}
Loop catloop3 is not empty:
<ul>
{loop type="category" name="catloop3" parent="0"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="catloop3"}
<p>Loop catloop3 is empty</p>
{/elseloop}
{elseloop rel="catloop2"}
<p>... but catloop2 is still empty :-)</p>
{/elseloop}
</div>
<div>
<p>Traditional for loop</p>
{for $index=5 to 12 step 1}
Compteur = {$index}<br />
{/for}
</div>
<div>
<p>Some pagination</p>
<p>PAGE 1</p>
<ul>
{loop type="category" name="catloopwithpagination1" limit="2" page="1"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
<p>PAGE 2</p>
<ul>
{loop type="category" name="catloopwithpagination2" limit="2" page="2"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
<p>PAGE 1000</p>
<ul>
{loop type="category" name="catloopwithpagination1000" limit="2" page="1000"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
{elseloop rel="catloopwithpagination1000"}
NO RESULTS
{/elseloop}
</ul>
</div>
<div>
<p>Some pagination with page choice</p>
{assign var=current_page value=2}
<p>PAGE {$current_page} :</p>
<ul>
{loop type="category" name="catloopwithpaginationchoice" limit="2" page="{$current_page}"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
<p>page choice</p>
{pageloop rel="catloopwithpaginationchoice"}
{if ${PAGE} != {$current_page}}
{if {$PAGE} > {$current_page}-10 AND {$PAGE} < {$current_page}+10}
{$PAGE}
{/if}
{if {$PAGE} == {$current_page}-10 OR {$PAGE} == {$current_page}+10}
...
{/if}
{if ({$PAGE} < {$current_page}-10 OR {$PAGE} > {$current_page}+10) AND ({$PAGE}%10 == 0 OR ${PAGE} == {$LAST} OR ${PAGE} == 1)}
{$PAGE}
{/if}
{else}
{ {$PAGE} }
{/if}
{if {$PAGE} != {$LAST}}
-
{/if}
{/pageloop}
</div>
{include file="includes/footer.html"}

View File

@@ -1,49 +0,0 @@
{include file="includes/header.html"}
<h1>{intl l='Please login'}</h1>
{form name="thelia.customer.login" }
<form action="{url path='/customer/login'}" method="post" {form_enctype form=$form}>
{*
The field below are not par of the Login form, it defines view to render if the form cannot be validated
*}
<input type="hidden" name="view" value="login" /> {* the view to return to if the form cannot be validated *}
{*
This field is common to all BaseForm instances (thus, this one), and defines
the URL the customer is redirected to once the form has been successfully
processed
*}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{navigate to="return_to"}" /> {* the url the user is redirected to on login success *}
{/form_field}
{*
The form error status and the form error messages are defined in Customer action,
and passed back to the form plugin through the ParserContext.
*}
{if $0form_error}<div class="alert alert-error">{$form_error_message}</div>{/if}
{form_hidden_fields form=$form}
{form_field form=$form field="email"}
{if $error}{$message}{/if}
<label>{intl l="Your e-mail address"}: </label><input type="email" name="{$name}" {$attr} value="{$value}"><br />
{/form_field}
{form_field form=$form field='password'}
<label>{intl l="Your password"}: </label><input type="password" name="{$name}" {$attr} value="{$value}"> <br />
{/form_field}
{form_field form=$form field='remember_me'}
<label class="checkbox"> <input type="checkbox" name="{$name}" value="{$value}" {$attr} {if $options.checked}checked="checked"{/if}/> {intl l='Remember me'}</label>
{/form_field}
<button type="submit">{intl l='Login'}</button>
</form>
{/form}
{include file='includes/footer.html'}

View File

@@ -1,6 +0,0 @@
{check_auth context="front" roles="CUSTOMER" login_tpl="login"}
{$page_title="{intl l='My Account'}"}
{include file="includes/header.html"}
{include file="includes/footer.html"}

View File

@@ -1,94 +0,0 @@
{assign var=category_current_page value={$smarty.get.category_page|default:1}}
<h1>Pagination</h1>
<h2>Categories</h2>
<div style="border: solid 1px; padding: 20px;">
{loop name="cat" type="category" page="{$category_current_page}" limit="2"}
<h2>{$LOOP_COUNT} - {$TITLE}</h2>
<h3>Products :</h3>
<div style="border: solid 1px; padding: 20px;">
{assign var=this_product_getter value="product_`$ID`_page"}
{assign var=product_current_page value={$smarty.get.$this_product_getter|default:1}}
<ul>
{loop name="prod" type="product" category="$ID" page="{$product_current_page}" limit="2"}
<li>
{$ID}:{$REF}
</li>
{/loop}
</ul>
</div>
<p>{$TITLE} page choice</p>
{pageloop rel="prod"}
{if $PAGE != $product_current_page}
<a href="index_dev.php?view=pagination&category_page={$category_current_page}&{$this_product_getter}={$PAGE}">{$PAGE}</a>
{else}
{$PAGE}
{/if}
{if $PAGE != $LAST}
-
{/if}
{/pageloop}
{/loop}
</div>
<p>categories page choice</p>
{pageloop rel="cat"}
{if $PAGE != $category_current_page}
<a href="index_dev.php?view=pagination&category_page={$PAGE}">{$PAGE}</a>
{else}
{$PAGE}
{/if}
{if $PAGE != $LAST}
-
{/if}
{/pageloop}
<hr>
Pagination before loop
<hr>
{assign var=product_current_page value={$smarty.get.$this_product_getter|default:1}}
{capture name="prod2"}
{loop name="prod2" type="product" page="{$product_current_page}" limit="2"}
<li>
{$ID}:{$REF}
</li>
{/loop}
{/capture}
{pageloop rel="prod2"}
{if ${PAGE} != {$product_current_page}}
<a href="index_dev.php?view=pagination&category_page={$category_current_page}&{$this_product_getter}={$PAGE}">{$PAGE}</a>
{else}
{$PAGE}
{/if}
{if $PAGE != $LAST}
-
{/if}
{/pageloop}
{$smarty.capture.prod2}
{pageloop rel="prod2"}
{if ${PAGE} != {$product_current_page}}
<a href="index_dev.php?view=pagination&category_page={$category_current_page}&{$this_product_getter}={$PAGE}">{$PAGE}</a>
{else}
{$PAGE}
{/if}
{if $PAGE != $LAST}
-
{/if}
{/pageloop}

View File

@@ -1,94 +0,0 @@
{*include file="includes/header.html"*}
Here you are : {navigate to="current"}<br />
From : {navigate to="return_to"}<br />
Index : {navigate to="index"}<br />
<h1>Product page</h1>
{ifloop rel="product"}
{loop type="product" name="product" current="true"}
<div style="border: dashed 2px red; padding: 20px; margin: 10px;">
<h2>PRODUCT ({$ID}) : {$REF}</h2>
<h3>{$TITLE}</h3>
<p>{$DESCRIPTION}</p>
<p>Starting by {$BEST_PRICE} {currency attr="symbol"} HT (TAX : {$BEST_PRICE_TAX} ; {$BEST_TAXED_PRICE} {currency attr="symbol"} TTC)</p>
{ifloop rel="acc"}
<h4>Accessories</h4>
<ul>
{loop name="acc" type="accessory" product="$ID" order="accessory"}
<li><a href="{$URL}">{$REF}</a></li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="acc"}
<h4>No accessory</h4>
{/elseloop}
{ifloop rel="prod_ass_cont"}
<h4>Associated Content</h4>
<ul>
{loop name="prod_ass_cont" type="associated_content" product="$ID" order="associated_content"}
<li>{$TITLE}</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="prod_ass_cont"}
<h4>No associated content</h4>
{/elseloop}
{ifloop rel="ft"}
<h4>Features</h4>
<ul>
{assign var=current_product value=$ID}
{loop name="ft" type="feature" order="manual" product="$ID"}
<li>
<strong>{$TITLE}</strong> :
{loop name="ft_v" type="feature_value" product="{$current_product}" feature="$ID"}
{$TITLE} / {$PERSONAL_VALUE}
{/loop}
</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="ft"}
<h4>No feature</h4>
{/elseloop}
<h4>Product sale elements</h4>
{assign var=current_product value=$ID}
{loop name="pse" type="product_sale_elements" product="$ID" order="promo,min_price"}
<div style="border: solid 2px darkorange; padding: 5px; margin: 5px;">
{loop name="combi" type="attribute_combination" product_sale_elements="$ID"}
{$ATTRIBUTE_TITLE} = {$ATTRIBUTE_AVAILABILITY_TITLE}<br />
{/loop}
<br />{$WEIGHT} g
<br /><strong>{if $IS_PROMO == 1} {$PROMO_PRICE} {currency attr="symbol"} HT // TAX : {$PROMO_PRICE_TAX} ; {$TAXED_PROMO_PRICE} {currency attr="symbol"} TTC (instead of {$PRICE} HT // TAX : {$PRICE_TAX} ; {$TAXED_PRICE} {currency attr="symbol"} TTC){else} {$PRICE} {currency attr="symbol"} HT // TAX : {$PRICE_TAX} ; {$TAXED_PRICE} {currency attr="symbol"} TTC{/if}</strong>
<br /><br />
Add
<select>
{for $will=1 to $QUANTITY}
<option>{$will}</option>
{/for}
</select>
to my cart
</ul>
</div>
{/loop}
</div>
{/loop}
{/ifloop}
{elseloop rel="product"}
<h2>Produit introuvable !</h2>
{/elseloop}
{*include file="includes/footer.html"*}

View File

@@ -1,11 +0,0 @@
<ul>
{loop name="car" type="category"}
<li>
<ul>
{loop name="product" type="product" category="$ID"}
<li>{$REF}</li>
{/loop}
</ul>
</li>
{/loop}
</ul>