Merge branch 'master' of https://github.com/thelia/thelia into coupon
# By Manuel Raynaud (8) and franck (2) # Via franck * 'master' of https://github.com/thelia/thelia: en_EN -> en_UK, the "en_EN" locale does not exists. Smarty inheritance in admin template. fix typo in phpdoc complete test for foramt_number smarty function test foramt_date without datetime object create foramt_number smarty function remove sqlmap file add some phpdoc complete test for format_date smarty function create new smarty function for displaying date in expected format Conflicts: reset_install.sh
This commit is contained in:
@@ -71,6 +71,7 @@ class Coupon extends BaseAction implements EventSubscriberInterface
|
||||
$event
|
||||
);
|
||||
|
||||
$couponModel = CouponQuery::create();
|
||||
$event->getCreatedCoupon()->save();
|
||||
|
||||
$this->dispatch(
|
||||
|
||||
120
core/lib/Thelia/Action/Currency.php
Normal file
120
core/lib/Thelia/Action/Currency.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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\Action;
|
||||
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
|
||||
use Thelia\Model\CurrencyQuery;
|
||||
use Thelia\Model\Currency as CurrencyModel;
|
||||
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
|
||||
use Thelia\Core\Event\CurrencyChangeEvent;
|
||||
use Thelia\Core\Event\CurrencyCreateEvent;
|
||||
use Thelia\Core\Event\CurrencyDeleteEvent;
|
||||
|
||||
class Currency extends BaseAction implements EventSubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Create a new currencyuration entry
|
||||
*
|
||||
* @param CurrencyCreateEvent $event
|
||||
*/
|
||||
public function create(CurrencyCreateEvent $event)
|
||||
{
|
||||
$currency = new CurrencyModel();
|
||||
|
||||
$currency
|
||||
->setDispatcher($this->getDispatcher())
|
||||
|
||||
->setLocale($event->getLocale())
|
||||
->setName($event->getCurrencyName())
|
||||
->setSymbol($event->getSymbol())
|
||||
->setRate($event->getRate())
|
||||
->setCode($event->getCode())
|
||||
|
||||
->save()
|
||||
;
|
||||
|
||||
$event->setCurrency($currency);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change a currency
|
||||
*
|
||||
* @param CurrencyChangeEvent $event
|
||||
*/
|
||||
public function modify(CurrencyChangeEvent $event)
|
||||
{
|
||||
$search = CurrencyQuery::create();
|
||||
|
||||
if (null !== $currency = CurrencyQuery::create()->findOneById($event->getCurrencyId())) {
|
||||
|
||||
$currency
|
||||
->setDispatcher($this->getDispatcher())
|
||||
|
||||
->setLocale($event->getLocale())
|
||||
->setName($event->getCurrencyName())
|
||||
->setSymbol($event->getSymbol())
|
||||
->setRate($event->getRate())
|
||||
->setCode($event->getCode())
|
||||
|
||||
->save();
|
||||
|
||||
$event->setCurrency($currency);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a currencyuration entry
|
||||
*
|
||||
* @param CurrencyDeleteEvent $event
|
||||
*/
|
||||
public function delete(CurrencyDeleteEvent $event)
|
||||
{
|
||||
|
||||
if (null !== ($currency = CurrencyQuery::create()->findOneById($event->getCurrencyId()))) {
|
||||
|
||||
$currency
|
||||
->setDispatcher($this->getDispatcher())
|
||||
->delete()
|
||||
;
|
||||
|
||||
$event->setCurrency($currency);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return array(
|
||||
TheliaEvents::CURRENCY_CREATE => array("create", 128),
|
||||
TheliaEvents::CURRENCY_MODIFY => array("modify", 128),
|
||||
TheliaEvents::CURRENCY_DELETE => array("delete", 128),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -32,12 +32,17 @@
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
<service id="thelia.action.category" class="Thelia\Action\Config">
|
||||
<service id="thelia.action.config" class="Thelia\Action\Config">
|
||||
<argument type="service" id="service_container"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
<service id="thelia.action.messages" class="Thelia\Action\Message">
|
||||
<service id="thelia.action.message" class="Thelia\Action\Message">
|
||||
<argument type="service" id="service_container"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
<service id="thelia.action.currency" class="Thelia\Action\Currency">
|
||||
<argument type="service" id="service_container"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
|
||||
<form name="thelia.admin.message.creation" class="Thelia\Form\MessageCreationForm"/>
|
||||
<form name="thelia.admin.message.modification" class="Thelia\Form\MessageModificationForm"/>
|
||||
|
||||
<form name="thelia.admin.currency.creation" class="Thelia\Form\CurrencyCreationForm"/>
|
||||
<form name="thelia.admin.currency.modification" class="Thelia\Form\CurrencyModificationForm"/>
|
||||
|
||||
<form name="thelia.admin.coupon.creation" class="Thelia\Form\CouponCreationForm"/>
|
||||
</forms>
|
||||
|
||||
|
||||
@@ -122,6 +127,11 @@
|
||||
<tag name="thelia.parser.register_plugin"/>
|
||||
</service>
|
||||
|
||||
<service id="smarty.plugin.format" class="Thelia\Core\Template\Smarty\Plugins\Format" scope="request">
|
||||
<argument type="service" id="request"/>
|
||||
<tag name="thelia.parser.register_plugin"/>
|
||||
</service>
|
||||
|
||||
<service id="smarty.plugin.thelialoop" class="Thelia\Core\Template\Smarty\Plugins\TheliaLoop" scope="request">
|
||||
<tag name="thelia.parser.register_plugin"/>
|
||||
|
||||
|
||||
@@ -47,18 +47,15 @@
|
||||
|
||||
<!-- Route to the Coupon controller (process Coupon browsing) -->
|
||||
<route id="admin.coupon.list" path="/admin/coupon">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::processAction</default>
|
||||
<default key="action">browse</default>
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::browseAction</default>
|
||||
</route>
|
||||
<route id="admin.coupon.create" path="/admin/coupon/create">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::processAction</default>
|
||||
<default key="action">create</default>
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::createAction</default>
|
||||
</route>
|
||||
<route id="admin.coupon.edit" path="/admin/coupon/edit/{id}">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::processAction</default>
|
||||
<default key="action">edit</default>
|
||||
<route id="admin.coupon.edit" path="/admin/coupon/edit/{couponId}">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::editAction</default>
|
||||
</route>
|
||||
<route id="admin.coupon.read" path="/admin/coupon/read/{id}">
|
||||
<route id="admin.coupon.read" path="/admin/coupon/read/{couponId}">
|
||||
<default key="_controller">Thelia\Controller\Admin\CouponController::readAction</default>
|
||||
</route>
|
||||
|
||||
@@ -115,6 +112,28 @@
|
||||
<default key="_controller">Thelia\Controller\Admin\MessageController::deleteAction</default>
|
||||
</route>
|
||||
|
||||
<!-- Routes to the Currencies controller -->
|
||||
|
||||
<route id="admin.configuration.currencies.default" path="/admin/configuration/currencies">
|
||||
<default key="_controller">Thelia\Controller\Admin\CurrencyController::defaultAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.configuration.currencies.create" path="/admin/configuration/currencies/create">
|
||||
<default key="_controller">Thelia\Controller\Admin\CurrencyController::createAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.configuration.currencies.change" path="/admin/configuration/currencies/change">
|
||||
<default key="_controller">Thelia\Controller\Admin\CurrencyController::changeAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.configuration.currencies.save-change" path="/admin/configuration/currencies/save-change">
|
||||
<default key="_controller">Thelia\Controller\Admin\CurrencyController::saveChangeAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.configuration.currencies.delete" path="/admin/configuration/currencies/delete">
|
||||
<default key="_controller">Thelia\Controller\Admin\CurrencyController::deleteAction</default>
|
||||
</route>
|
||||
|
||||
<!-- The default route, to display a template -->
|
||||
|
||||
<route id="admin.processTemplate" path="/admin/{template}">
|
||||
|
||||
@@ -199,12 +199,21 @@ class BaseAdminController extends BaseController
|
||||
// Find the current edit language ID
|
||||
$edition_language = $this->getCurrentEditionLangId();
|
||||
|
||||
// Current back-office (not edition) language
|
||||
$current_lang = LangQuery::create()->findOneById($session->getLangId());
|
||||
|
||||
// Prepare common template variables
|
||||
$args = array_merge($args, array(
|
||||
'locale' => $session->getLocale(),
|
||||
'lang_code' => $session->getLang(),
|
||||
'lang_id' => $session->getLangId(),
|
||||
|
||||
'datetime_format' => $current_lang->getDateTimeFormat(),
|
||||
'date_format' => $current_lang->getDateFormat(),
|
||||
'time_format' => $current_lang->getTimeFormat(),
|
||||
|
||||
'edition_language' => $edition_language,
|
||||
|
||||
'current_url' => htmlspecialchars($this->getRequest()->getUri())
|
||||
));
|
||||
|
||||
|
||||
@@ -25,12 +25,14 @@ namespace Thelia\Controller\Admin;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Thelia\Core\Event\Coupon\CouponCreateEvent;
|
||||
use Thelia\Core\Event\Coupon\CouponEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Core\Security\Exception\AuthenticationException;
|
||||
use Thelia\Core\Security\Exception\AuthorizationException;
|
||||
use Thelia\Coupon\CouponRuleCollection;
|
||||
use Thelia\Form\CouponCreationForm;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Log\Tlog;
|
||||
use Thelia\Model\Coupon;
|
||||
use Thelia\Model\CouponQuery;
|
||||
|
||||
@@ -47,28 +49,16 @@ use Thelia\Model\CouponQuery;
|
||||
*/
|
||||
class CouponController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* List all Coupons Action
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->process();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Coupons list display
|
||||
*
|
||||
* @param array $args GET arguments
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
protected function browseCoupons($args)
|
||||
public function browseAction()
|
||||
{
|
||||
$this->checkAuth("ADMIN", "admin.coupon.view");
|
||||
|
||||
return $this->render('coupon/list', $args);
|
||||
return $this->render('coupon-list');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,74 +68,89 @@ class CouponController extends BaseAdminController
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function createAction($args)
|
||||
public function createAction()
|
||||
{
|
||||
// Check current user authorization
|
||||
if (null !== $response = $this->checkAuth("admin.coupon.create")) return $response;
|
||||
$response = $this->checkAuth("admin.coupon.create");
|
||||
if ($response !== null) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$message = false;
|
||||
|
||||
// Create the form from the request
|
||||
$creationForm = new CouponCreationForm($this->getRequest());
|
||||
|
||||
if ($this->getRequest()->isMethod('POST')) {
|
||||
try {
|
||||
// Create the form from the request
|
||||
$creationForm = new CouponCreationForm(Form($this->getRequest()));
|
||||
|
||||
// Check the form against constraints violations
|
||||
$form = $this->validateForm($creationForm, "POST");
|
||||
|
||||
// Get the form field values
|
||||
$data = $form->getData();
|
||||
|
||||
var_dump($data);
|
||||
|
||||
$couponCreateEvent = new CouponCreateEvent();
|
||||
$couponCreateEvent->setTitle($data['title']);
|
||||
$couponCreateEvent->setShortDescription($data['shortDescription']);
|
||||
$couponCreateEvent->setDescription($data['longDescription']);
|
||||
$couponCreateEvent->setCode($data['code']);
|
||||
$couponCreateEvent->setAmount($data['amount']);
|
||||
|
||||
$couponCreateEvent->setExpirationDate(
|
||||
new \DateTime($data['expirationDate'])
|
||||
$couponEvent = new CouponEvent(
|
||||
$data['code'],
|
||||
$data['title'],
|
||||
$data['amount'],
|
||||
$data['effect'],
|
||||
$data['shortDescription'],
|
||||
$data['description'],
|
||||
$data['isEnabled'],
|
||||
new \DateTime($data['expirationDate']),
|
||||
$data['isAvailableOnSpecialOffers'],
|
||||
$data['isCumulative'],
|
||||
$data['isRemovingPostage'],
|
||||
$data['maxUsage'],
|
||||
array()
|
||||
);
|
||||
$couponCreateEvent->setMaxUsage($data['maxUsage']);
|
||||
$couponCreateEvent->setIsCumulative($data['isCumulative']);
|
||||
$couponCreateEvent->setIsRemovingPostage($data['isRemovingPostage']);
|
||||
$couponCreateEvent->setIsAvailableOnSpecialOffers($data['isAvailableOnSpecialOffers']);
|
||||
|
||||
$couponCreateEvent->setIsEnabled($data['isEnabled']);
|
||||
|
||||
// $couponCreateEvent->setRules($data['rules']);
|
||||
|
||||
$this->dispatch(
|
||||
TheliaEvents::CREATE_COUPON,
|
||||
$couponCreateEvent
|
||||
TheliaEvents::COUPON_CREATE,
|
||||
$couponEvent
|
||||
);
|
||||
$this->adminLogAppend(
|
||||
sprintf(
|
||||
'Coupon %s (ID %s) created',
|
||||
$couponCreateEvent->getTitle(),
|
||||
$couponCreateEvent->getId()
|
||||
$couponEvent->getTitle(),
|
||||
$couponEvent->getId()
|
||||
)
|
||||
);
|
||||
// @todo redirect if successful
|
||||
} catch (FormValidationException $e) {
|
||||
$creationForm->setErrorMessage($e->getMessage());
|
||||
$this->getParserContext()->setErrorForm($creationForm);
|
||||
// Invalid data entered
|
||||
$message = 'Please check your input:';
|
||||
} catch (\Exception $e) {
|
||||
// Any other error
|
||||
$message = 'Sorry, an error occured:';
|
||||
}
|
||||
|
||||
if ($message !== false) {
|
||||
// Log error message
|
||||
Tlog::getInstance()->error(
|
||||
sprintf(
|
||||
"Failed to create coupon: %s",
|
||||
$e->getMessage()
|
||||
"Error during variable modification process : %s. Exception was %s",
|
||||
$message, $e->getMessage()
|
||||
)
|
||||
);
|
||||
$this->getParserContext()->setGeneralError($e->getMessage());
|
||||
}
|
||||
} else {
|
||||
|
||||
// Mark the form as errored
|
||||
$creationForm->setErrorMessage($message);
|
||||
|
||||
// Pas the form and the error to the parser
|
||||
$this->getParserContext()
|
||||
->addForm($creationForm)
|
||||
->setGeneralError($message)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('coupon/create', array('action' => 'create'));
|
||||
$formAction = 'admin/coupon/create';
|
||||
return $this->render(
|
||||
'coupon-create',
|
||||
array(
|
||||
'formAction' => $formAction
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,74 +160,35 @@ class CouponController extends BaseAdminController
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
protected function editCoupon($args)
|
||||
public function editAction($couponId)
|
||||
{
|
||||
$this->checkAuth("ADMIN", "admin.coupon.view");
|
||||
$this->checkAuth("ADMIN", "admin.coupon.edit");
|
||||
|
||||
return $this->render('coupon/update', $args);
|
||||
$formAction = 'admin/coupon/edit/' . $couponId;
|
||||
|
||||
return $this->render('coupon-edit', array('formAction' => $formAction));
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Coupons read display
|
||||
*
|
||||
* @param int $id Coupon Id
|
||||
* @param int $couponId Coupon Id
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function readAction($id)
|
||||
public function readAction($couponId)
|
||||
{
|
||||
$this->checkAuth("ADMIN", "admin.coupon.read");
|
||||
|
||||
// Database request repeated in the loop but cached
|
||||
$search = CouponQuery::create();
|
||||
$coupon = $search->findOneById($id);
|
||||
$coupon = $search->findOneById($couponId);
|
||||
|
||||
if ($coupon === null) {
|
||||
return $this->pageNotFound();
|
||||
}
|
||||
|
||||
return $this->render('coupon/read', array('couponId' => $id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Process all Actions
|
||||
*
|
||||
* @param string $action Action to process
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function processAction()
|
||||
{
|
||||
// Get the current action
|
||||
$action = $this->getRequest()->get('action', 'browse');
|
||||
|
||||
// Get the category ID
|
||||
// $id = $this->getRequest()->get('id', 0);
|
||||
|
||||
$args = array(
|
||||
'action' => $action,
|
||||
// 'current_coupon_id' => $id
|
||||
);
|
||||
|
||||
try {
|
||||
switch ($action) {
|
||||
case 'browse' : // Browse coupon
|
||||
return $this->browseCoupons($args);
|
||||
case 'create' : // Create a new coupon
|
||||
// return $this->createCoupon($args);
|
||||
case 'edit' : // Edit an existing coupon
|
||||
return $this->editCoupon($args);
|
||||
case 'read' : // Read an existing coupon
|
||||
return $this->readCoupon($args);
|
||||
}
|
||||
} catch (AuthorizationException $ex) {
|
||||
return $this->errorPage($ex->getMessage());
|
||||
} catch (AuthenticationException $ex) {
|
||||
return $this->errorPage($ex->getMessage());
|
||||
}
|
||||
|
||||
// We did not recognized the action -> return a 404 page
|
||||
return $this->pageNotFound();
|
||||
return $this->render('coupon-read', array('couponId' => $couponId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
284
core/lib/Thelia/Controller/Admin/CurrencyController.php
Normal file
284
core/lib/Thelia/Controller/Admin/CurrencyController.php
Normal file
@@ -0,0 +1,284 @@
|
||||
<?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\CurrencyDeleteEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Tools\URL;
|
||||
use Thelia\Core\Event\CurrencyChangeEvent;
|
||||
use Thelia\Core\Event\CurrencyCreateEvent;
|
||||
use Thelia\Log\Tlog;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Core\Security\Exception\AuthorizationException;
|
||||
use Thelia\Model\CurrencyQuery;
|
||||
use Thelia\Form\CurrencyModificationForm;
|
||||
use Thelia\Form\CurrencyCreationForm;
|
||||
|
||||
/**
|
||||
* Manages currencies sent by mail
|
||||
*
|
||||
* @author Franck Allimant <franck@cqfdev.fr>
|
||||
*/
|
||||
class CurrencyController extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* Render the currencies list, ensuring the sort order is set.
|
||||
*
|
||||
* @return Symfony\Component\HttpFoundation\Response the response
|
||||
*/
|
||||
protected function renderList() {
|
||||
|
||||
// Find the current order
|
||||
$order = $this->getRequest()->get(
|
||||
'order',
|
||||
$this->getSession()->get('admin.currency_order', 'manual')
|
||||
);
|
||||
|
||||
// Store the current sort order in session
|
||||
$this->getSession()->set('admin.currency_order', $order);
|
||||
|
||||
return $this->render('currencies', array('order' => $order));
|
||||
}
|
||||
|
||||
/**
|
||||
* The default action is displaying the currencies list.
|
||||
*
|
||||
* @return Symfony\Component\HttpFoundation\Response the response
|
||||
*/
|
||||
public function defaultAction() {
|
||||
|
||||
if (null !== $response = $this->checkAuth("admin.configuration.currencies.view")) return $response;
|
||||
|
||||
return $this->renderList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new currency object
|
||||
*
|
||||
* @return Symfony\Component\HttpFoundation\Response the response
|
||||
*/
|
||||
public function createAction() {
|
||||
|
||||
// Check current user authorization
|
||||
if (null !== $response = $this->checkAuth("admin.configuration.currencies.create")) return $response;
|
||||
|
||||
$currency = false;
|
||||
|
||||
// Create the Creation Form
|
||||
$creationForm = new CurrencyCreationForm($this->getRequest());
|
||||
|
||||
try {
|
||||
|
||||
// Validate the form, create the CurrencyCreation event and dispatch it.
|
||||
$form = $this->validateForm($creationForm, "POST");
|
||||
|
||||
$data = $form->getData();
|
||||
|
||||
$createEvent = new CurrencyCreateEvent();
|
||||
|
||||
$createEvent
|
||||
->setCurrencyName($data['name'])
|
||||
->setLocale($data["locale"])
|
||||
->setSymbol($data['symbol'])
|
||||
;
|
||||
|
||||
$this->dispatch(TheliaEvents::CURRENCY_CREATE, $createEvent);
|
||||
|
||||
$createdObject = $createEvent->getCurrency();
|
||||
|
||||
// Log currency creation
|
||||
$this->adminLogAppend(sprintf("Variable %s (ID %s) created", $createdObject->getName(), $createdObject->getId()));
|
||||
|
||||
// Substitute _ID_ in the URL with the ID of the created object
|
||||
$successUrl = str_replace('_ID_', $createdObject->getId(), $creationForm->getSuccessUrl());
|
||||
|
||||
// Redirect to the success URL
|
||||
$this->redirect($successUrl);
|
||||
}
|
||||
catch (FormValidationException $ex) {
|
||||
// Form cannot be validated
|
||||
$currency = sprintf("Please check your input: %s", $ex->getCurrency());
|
||||
}
|
||||
catch (\Exception $ex) {
|
||||
// Any other error
|
||||
$currency = sprintf("Sorry, an error occured: %s", $ex->getCurrency());
|
||||
}
|
||||
|
||||
if ($currency !== false) {
|
||||
// An error has been detected: log it
|
||||
Tlog::getInstance()->error(sprintf("Error during currency creation process : %s. Exception was %s", $currency, $ex->getCurrency()));
|
||||
|
||||
// Mark the form as errored
|
||||
$creationForm->setErrorCurrency($currency);
|
||||
|
||||
// Pass it to the parser, along with the error currency
|
||||
$this->getParserContext()
|
||||
->addForm($creationForm)
|
||||
->setGeneralError($currency)
|
||||
;
|
||||
}
|
||||
|
||||
// At this point, the form has error, and should be redisplayed.
|
||||
return $this->renderList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a currency object for modification, and display the edit template.
|
||||
*
|
||||
* @return Symfony\Component\HttpFoundation\Response the response
|
||||
*/
|
||||
public function changeAction() {
|
||||
|
||||
// Check current user authorization
|
||||
if (null !== $response = $this->checkAuth("admin.configuration.currencies.change")) return $response;
|
||||
|
||||
// Load the currency object
|
||||
$currency = CurrencyQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
->findOneById($this->getRequest()->get('currency_id'));
|
||||
|
||||
if ($currency != null) {
|
||||
|
||||
// Prepare the data that will hydrate the form
|
||||
$data = array(
|
||||
'id' => $currency->getId(),
|
||||
'name' => $currency->getName(),
|
||||
'locale' => $currency->getLocale(),
|
||||
'code' => $currency->getCode(),
|
||||
'symbol' => $currency->getSymbol(),
|
||||
'rate' => $currency->getSubject()
|
||||
);
|
||||
|
||||
// Setup the object form
|
||||
$changeForm = new CurrencyModificationForm($this->getRequest(), "form", $data);
|
||||
|
||||
// Pass it to the parser
|
||||
$this->getParserContext()->addForm($changeForm);
|
||||
}
|
||||
|
||||
// Render the edition template.
|
||||
return $this->render('currency-edit', array('currency_id' => $this->getRequest()->get('currency_id')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save changes on a modified currency object, and either go back to the currency list, or stay on the edition page.
|
||||
*
|
||||
* @return Symfony\Component\HttpFoundation\Response the response
|
||||
*/
|
||||
public function saveChangeAction() {
|
||||
|
||||
// Check current user authorization
|
||||
if (null !== $response = $this->checkAuth("admin.configuration.currencies.change")) return $response;
|
||||
|
||||
$currency = false;
|
||||
|
||||
// Create the form from the request
|
||||
$changeForm = new CurrencyModificationForm($this->getRequest());
|
||||
|
||||
// Get the currency ID
|
||||
$currency_id = $this->getRequest()->get('currency_id');
|
||||
|
||||
try {
|
||||
|
||||
// Check the form against constraints violations
|
||||
$form = $this->validateForm($changeForm, "POST");
|
||||
|
||||
// Get the form field values
|
||||
$data = $form->getData();
|
||||
|
||||
$changeEvent = new CurrencyChangeEvent($data['id']);
|
||||
|
||||
// Create and dispatch the change event
|
||||
$changeEvent
|
||||
->setCurrencyName($data['name'])
|
||||
->setLocale($data["locale"])
|
||||
->setSymbol($data['symbol'])
|
||||
->setCode($data['code'])
|
||||
->setRate($data['rate'])
|
||||
;
|
||||
|
||||
$this->dispatch(TheliaEvents::CURRENCY_MODIFY, $changeEvent);
|
||||
|
||||
// Log currency modification
|
||||
$changedObject = $changeEvent->getCurrency();
|
||||
|
||||
$this->adminLogAppend(sprintf("Variable %s (ID %s) modified", $changedObject->getName(), $changedObject->getId()));
|
||||
|
||||
// If we have to stay on the same page, do not redirect to the succesUrl,
|
||||
// just redirect to the edit page again.
|
||||
if ($this->getRequest()->get('save_mode') == 'stay') {
|
||||
$this->redirect(URL::absoluteUrl(
|
||||
"admin/configuration/currencies/change",
|
||||
array('currency_id' => $currency_id)
|
||||
));
|
||||
}
|
||||
|
||||
// Redirect to the success URL
|
||||
$this->redirect($changeForm->getSuccessUrl());
|
||||
}
|
||||
catch (FormValidationException $ex) {
|
||||
// Invalid data entered
|
||||
$currency = sprintf("Please check your input: %s", $ex->getCurrency());
|
||||
}
|
||||
catch (\Exception $ex) {
|
||||
// Any other error
|
||||
$currency = sprintf("Sorry, an error occured: %s", $ex->getCurrency());
|
||||
}
|
||||
|
||||
if ($currency !== false) {
|
||||
// Log error currency
|
||||
Tlog::getInstance()->error(sprintf("Error during currency modification process : %s. Exception was %s", $currency, $ex->getCurrency()));
|
||||
|
||||
// Mark the form as errored
|
||||
$changeForm->setErrorCurrency($currency);
|
||||
|
||||
// Pas the form and the error to the parser
|
||||
$this->getParserContext()
|
||||
->addForm($changeForm)
|
||||
->setGeneralError($currency)
|
||||
;
|
||||
}
|
||||
|
||||
// At this point, the form has errors, and should be redisplayed.
|
||||
return $this->render('currency-edit', array('currency_id' => $currency_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a currency object
|
||||
*
|
||||
* @return Symfony\Component\HttpFoundation\Response the response
|
||||
*/
|
||||
public function deleteAction() {
|
||||
|
||||
// Check current user authorization
|
||||
if (null !== $response = $this->checkAuth("admin.configuration.currencies.delete")) return $response;
|
||||
|
||||
// Get the currency id, and dispatch the delet request
|
||||
$event = new CurrencyDeleteEvent($this->getRequest()->get('currency_id'));
|
||||
|
||||
$this->dispatch(TheliaEvents::CURRENCY_DELETE, $event);
|
||||
|
||||
$this->redirect(URL::adminViewUrl('currencies'));
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<?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\Core\Event\Coupon;
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
use Thelia\Model\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
* Date: 8/29/13
|
||||
* Time: 3:45 PM
|
||||
*
|
||||
* Occurring when a Coupon is edited
|
||||
*
|
||||
* @package Coupon
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class CouponEditEvent extends ActionEvent
|
||||
{
|
||||
/** @var int Coupon being edited id */
|
||||
protected $couponId;
|
||||
|
||||
/** @var Coupon Coupon being created */
|
||||
protected $editedCoupon;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Coupon $coupon Coupon being edited
|
||||
*/
|
||||
public function __construct(Coupon $coupon)
|
||||
{
|
||||
$this->created_coupon = $coupon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify Coupon being created
|
||||
*
|
||||
* @param Coupon $editedCoupon Coupon being created
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCreatedCoupon(Coupon $editedCoupon)
|
||||
{
|
||||
$this->editedCoupon = $editedCoupon;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Coupon being created
|
||||
*
|
||||
* @return Coupon
|
||||
*/
|
||||
public function getCreatedCoupon()
|
||||
{
|
||||
return clone $this->editedCoupon;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -22,8 +22,10 @@
|
||||
/**********************************************************************************/
|
||||
|
||||
namespace Thelia\Core\Event\Coupon;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
use Thelia\Coupon\CouponRuleCollection;
|
||||
use Thelia\Model\Coupon;
|
||||
|
||||
/**
|
||||
* Created by JetBrains PhpStorm.
|
||||
@@ -36,8 +38,11 @@ use Thelia\Coupon\CouponRuleCollection;
|
||||
* @author Guillaume MOREL <gmorel@openstudio.fr>
|
||||
*
|
||||
*/
|
||||
class CouponCreateEvent extends ActionEvent
|
||||
class CouponEvent extends ActionEvent
|
||||
{
|
||||
/** @var int Coupon Id */
|
||||
protected $id = null;
|
||||
|
||||
/** @var CouponRuleCollection Array of CouponRuleInterface */
|
||||
protected $rules = null;
|
||||
|
||||
@@ -74,6 +79,72 @@ class CouponCreateEvent extends ActionEvent
|
||||
/** @var bool if Coupon is available for Products already on special offers */
|
||||
protected $isAvailableOnSpecialOffers = false;
|
||||
|
||||
/** @var Coupon Coupon model */
|
||||
protected $coupon = null;
|
||||
|
||||
/** @var string Coupon effect */
|
||||
protected $effect;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $code Coupon Code
|
||||
* @param string $title Coupon title
|
||||
* @param float $amount Amount removed from the Total Checkout
|
||||
* @param string $effect Coupon effect
|
||||
* @param string $shortDescription Coupon short description
|
||||
* @param string $description Coupon description
|
||||
* @param boolean $isEnabled Enable/Disable
|
||||
* @param \DateTime $expirationDate Coupon expiration date
|
||||
* @param boolean $isAvailableOnSpecialOffers Is available on special offers
|
||||
* @param boolean $isCumulative Is cumulative
|
||||
* @param boolean $isRemovingPostage Is removing Postage
|
||||
* @param int $maxUsage Coupon quantity
|
||||
* @param CouponRuleCollection $rules CouponRuleInterface to add
|
||||
* @param int $id Coupon id
|
||||
*/
|
||||
function __construct(
|
||||
$code,
|
||||
$title,
|
||||
$amount,
|
||||
$effect,
|
||||
$shortDescription,
|
||||
$description,
|
||||
$isEnabled,
|
||||
$expirationDate,
|
||||
$isAvailableOnSpecialOffers,
|
||||
$isCumulative,
|
||||
$isRemovingPostage,
|
||||
$maxUsage,
|
||||
$rules,
|
||||
$id = null
|
||||
) {
|
||||
$this->amount = $amount;
|
||||
$this->code = $code;
|
||||
$this->description = $description;
|
||||
$this->expirationDate = $expirationDate;
|
||||
$this->id = $id;
|
||||
$this->isAvailableOnSpecialOffers = $isAvailableOnSpecialOffers;
|
||||
$this->isCumulative = $isCumulative;
|
||||
$this->isEnabled = $isEnabled;
|
||||
$this->isRemovingPostage = $isRemovingPostage;
|
||||
$this->maxUsage = $maxUsage;
|
||||
$this->rules = $rules;
|
||||
$this->shortDescription = $shortDescription;
|
||||
$this->title = $title;
|
||||
$this->effect = $effect;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Coupon Id
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Coupon code (ex: XMAS)
|
||||
*
|
||||
@@ -156,62 +227,6 @@ class CouponCreateEvent extends ActionEvent
|
||||
return clone $this->rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set effects generated by the coupon
|
||||
*
|
||||
* @param float $amount Amount removed from the Total Checkout
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAmount($amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Coupon Code
|
||||
*
|
||||
* @param string $code Coupon Code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCode($code)
|
||||
{
|
||||
$this->code = $code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Coupon description
|
||||
*
|
||||
* @param string $description Coupon description
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Coupon expiration date (date given considered as expired)
|
||||
*
|
||||
* @param \DateTime $expirationDate Coupon expiration date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpirationDate($expirationDate)
|
||||
{
|
||||
$this->expirationDate = $expirationDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return Coupon expiration date
|
||||
*
|
||||
@@ -222,20 +237,6 @@ class CouponCreateEvent extends ActionEvent
|
||||
return clone $this->expirationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if Coupon is available on special offers
|
||||
*
|
||||
* @param boolean $isAvailableOnSpecialOffers is available on special offers
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsAvailableOnSpecialOffers($isAvailableOnSpecialOffers)
|
||||
{
|
||||
$this->isAvailableOnSpecialOffers = $isAvailableOnSpecialOffers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If Coupon is available on special offers
|
||||
*
|
||||
@@ -246,34 +247,6 @@ class CouponCreateEvent extends ActionEvent
|
||||
return $this->isAvailableOnSpecialOffers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if the Coupon is cumulative with other Coupons or not
|
||||
*
|
||||
* @param boolean $isCumulative is cumulative
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsCumulative($isCumulative)
|
||||
{
|
||||
$this->isCumulative = $isCumulative;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable/Disable the Coupon
|
||||
*
|
||||
* @param boolean $isEnabled Enable/Disable
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsEnabled($isEnabled)
|
||||
{
|
||||
$this->isEnabled = $isEnabled;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get if Coupon is enabled or not
|
||||
*
|
||||
@@ -284,34 +257,6 @@ class CouponCreateEvent extends ActionEvent
|
||||
return $this->isEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if Coupon is removing Postage
|
||||
*
|
||||
* @param boolean $isRemovingPostage is removing Postage
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsRemovingPostage($isRemovingPostage)
|
||||
{
|
||||
$this->isRemovingPostage = $isRemovingPostage;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set how many time a coupon can be used (-1 : unlimited)
|
||||
*
|
||||
* @param int $maxUsage Coupon quantity
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMaxUsage($maxUsage)
|
||||
{
|
||||
$this->maxUsage = $maxUsage;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return how many time the Coupon can be used again
|
||||
* Ex : -1 unlimited
|
||||
@@ -324,51 +269,33 @@ class CouponCreateEvent extends ActionEvent
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace the existing Rules by those given in parameter
|
||||
* If one Rule is badly implemented, no Rule will be added
|
||||
* Get Coupon effect
|
||||
*
|
||||
* @param CouponRuleCollection $rules CouponRuleInterface to add
|
||||
*
|
||||
* @return $this
|
||||
* @throws \Thelia\Exception\InvalidRuleException
|
||||
* @return string
|
||||
*/
|
||||
public function setRules(CouponRuleCollection $rules)
|
||||
public function getEffect()
|
||||
{
|
||||
$this->rules = $rules;
|
||||
$this->constraintManager = new ConstraintManager(
|
||||
$this->adapter,
|
||||
$this->rules
|
||||
);
|
||||
return $this->effect;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
||||
|
||||
/**
|
||||
* @param \Thelia\Model\Coupon $coupon
|
||||
*/
|
||||
public function setCoupon($coupon)
|
||||
{
|
||||
$this->coupon = $coupon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Coupon short description
|
||||
*
|
||||
* @param string $shortDescription Coupon short description
|
||||
*
|
||||
* @return $this
|
||||
* @return \Thelia\Model\Coupon
|
||||
*/
|
||||
public function setShortDescription($shortDescription)
|
||||
public function getCoupon()
|
||||
{
|
||||
$this->shortDescription = $shortDescription;
|
||||
|
||||
return $this;
|
||||
return $this->coupon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Coupon title
|
||||
*
|
||||
* @param string $title Coupon title
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
47
core/lib/Thelia/Core/Event/CurrencyChangeEvent.php
Normal file
47
core/lib/Thelia/Core/Event/CurrencyChangeEvent.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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\Core\Event;
|
||||
use Thelia\Model\Currency;
|
||||
|
||||
class CurrencyChangeEvent extends CurrencyCreateEvent
|
||||
{
|
||||
protected $currency_id;
|
||||
|
||||
public function __construct($currency_id)
|
||||
{
|
||||
$this->setCurrencyId($currency_id);
|
||||
}
|
||||
|
||||
public function getCurrencyId()
|
||||
{
|
||||
return $this->currency_id;
|
||||
}
|
||||
|
||||
public function setCurrencyId($currency_id)
|
||||
{
|
||||
$this->currency_id = $currency_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
93
core/lib/Thelia/Core/Event/CurrencyCreateEvent.php
Normal file
93
core/lib/Thelia/Core/Event/CurrencyCreateEvent.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?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\Core\Event;
|
||||
use Thelia\Model\Currency;
|
||||
|
||||
class CurrencyCreateEvent extends CurrencyEvent
|
||||
{
|
||||
protected $currency_name;
|
||||
protected $locale;
|
||||
protected $symbol;
|
||||
protected $code;
|
||||
protected $rate;
|
||||
|
||||
// Use currency_name to prevent conflict with Event::name property.
|
||||
public function getCurrencyName()
|
||||
{
|
||||
return $this->currency_name;
|
||||
}
|
||||
|
||||
public function setCurrencyName($currency_name)
|
||||
{
|
||||
$this->currency_name = $currency_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->locale;
|
||||
}
|
||||
|
||||
public function setLocale($locale)
|
||||
{
|
||||
$this->locale = $locale;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSymbol()
|
||||
{
|
||||
return $this->symbol;
|
||||
}
|
||||
|
||||
public function setSymbol($symbol)
|
||||
{
|
||||
$this->symbol = $symbol;
|
||||
}
|
||||
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
public function setCode($code)
|
||||
{
|
||||
$this->code = $code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRate()
|
||||
{
|
||||
return $this->rate;
|
||||
}
|
||||
|
||||
public function setRate($rate)
|
||||
{
|
||||
$this->rate = $rate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
48
core/lib/Thelia/Core/Event/CurrencyDeleteEvent.php
Normal file
48
core/lib/Thelia/Core/Event/CurrencyDeleteEvent.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?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\Core\Event;
|
||||
|
||||
use Thelia\Model\Currency;
|
||||
|
||||
class CurrencyDeleteEvent extends CurrencyEvent
|
||||
{
|
||||
protected $currency_id;
|
||||
|
||||
public function __construct($currency_id)
|
||||
{
|
||||
$this->setCurrencyId($currency_id);
|
||||
}
|
||||
|
||||
public function getCurrencyId()
|
||||
{
|
||||
return $this->currency_id;
|
||||
}
|
||||
|
||||
public function setCurrencyId($currency_id)
|
||||
{
|
||||
$this->currency_id = $currency_id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
47
core/lib/Thelia/Core/Event/CurrencyEvent.php
Normal file
47
core/lib/Thelia/Core/Event/CurrencyEvent.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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\Core\Event;
|
||||
use Thelia\Model\Currency;
|
||||
|
||||
class CurrencyEvent extends ActionEvent
|
||||
{
|
||||
protected $currency;
|
||||
|
||||
public function __construct(Currency $currency = null)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
}
|
||||
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
public function setCurrency($currency)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -266,7 +266,6 @@ final class TheliaEvents
|
||||
const BEFORE_DELETECONFIG = "action.before_deleteConfig";
|
||||
const AFTER_DELETECONFIG = "action.after_deleteConfig";
|
||||
|
||||
|
||||
// -- Messages management ---------------------------------------------
|
||||
|
||||
const MESSAGE_CREATE = "action.createMessage";
|
||||
@@ -282,4 +281,18 @@ final class TheliaEvents
|
||||
const BEFORE_DELETEMESSAGE = "action.before_deleteMessage";
|
||||
const AFTER_DELETEMESSAGE = "action.after_deleteMessage";
|
||||
|
||||
// -- Currencies management ---------------------------------------------
|
||||
|
||||
const CURRENCY_CREATE = "action.createCurrency";
|
||||
const CURRENCY_MODIFY = "action.changeCurrency";
|
||||
const CURRENCY_DELETE = "action.deleteCurrency";
|
||||
|
||||
const BEFORE_CREATECURRENCY = "action.before_createCurrency";
|
||||
const AFTER_CREATECURRENCY = "action.after_createCurrency";
|
||||
|
||||
const BEFORE_CHANGECURRENCY = "action.before_changeCurrency";
|
||||
const AFTER_CHANGECURRENCY = "action.after_changeCurrency";
|
||||
|
||||
const BEFORE_DELETECURRENCY = "action.before_deleteCurrency";
|
||||
const AFTER_DELETECURRENCY = "action.after_deleteCurrency";
|
||||
}
|
||||
|
||||
@@ -55,12 +55,15 @@ class Session extends BaseSession
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Thelia\Model\Lang|null
|
||||
*/
|
||||
public function getLang()
|
||||
{
|
||||
return $this->get("lang", substr($this->getLocale(), 0, 2));
|
||||
return $this->get("lang");
|
||||
}
|
||||
|
||||
public function setLang($lang)
|
||||
public function setLang(Lang $lang)
|
||||
{
|
||||
$this->set("lang", $lang);
|
||||
|
||||
|
||||
@@ -109,13 +109,13 @@ class Config extends BaseI18nLoop
|
||||
->set("NAME" , $result->getName())
|
||||
->set("VALUE" , $result->getValue())
|
||||
->set("IS_TRANSLATED", $result->getVirtualColumn('IS_TRANSLATED'))
|
||||
->set("LOCALE",$locale)
|
||||
->set("LOCALE" , $locale)
|
||||
->set("TITLE" , $result->getVirtualColumn('i18n_TITLE'))
|
||||
->set("CHAPO" , $result->getVirtualColumn('i18n_CHAPO'))
|
||||
->set("DESCRIPTION" , $result->getVirtualColumn('i18n_DESCRIPTION'))
|
||||
->set("POSTSCRIPTUM" , $result->getVirtualColumn('i18n_POSTSCRIPTUM'))
|
||||
->set("HIDDEN" , $result->getHidden())
|
||||
->set("SECURED" , $result->getSecured())
|
||||
->set("SECURED" , $result->getSecured())
|
||||
->set("CREATE_DATE" , $result->getCreatedAt())
|
||||
->set("UPDATE_DATE" , $result->getUpdatedAt())
|
||||
;
|
||||
|
||||
@@ -33,6 +33,8 @@ use Thelia\Core\Template\Loop\Argument\Argument;
|
||||
|
||||
use Thelia\Model\CurrencyQuery;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Type\TypeCollection;
|
||||
use Thelia\Type\EnumListType;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -53,7 +55,22 @@ class Currency extends BaseI18nLoop
|
||||
return new ArgumentCollection(
|
||||
Argument::createIntListTypeArgument('id'),
|
||||
Argument::createIntListTypeArgument('exclude'),
|
||||
Argument::createBooleanTypeArgument('default_only', false)
|
||||
Argument::createBooleanTypeArgument('default_only', false),
|
||||
new Argument(
|
||||
'order',
|
||||
new TypeCollection(
|
||||
new EnumListType(
|
||||
array(
|
||||
'id', 'id_reverse',
|
||||
'name', 'name_reverse',
|
||||
'code', 'code_reverse',
|
||||
'symbol', 'symbol_reverse',
|
||||
'rate', 'rate_reverse',
|
||||
'manual', 'manual_reverse')
|
||||
)
|
||||
),
|
||||
'manual'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -87,7 +104,53 @@ class Currency extends BaseI18nLoop
|
||||
$search->filterByByDefault(true);
|
||||
}
|
||||
|
||||
$search->orderByPosition();
|
||||
$orders = $this->getOrder();
|
||||
|
||||
foreach($orders as $order) {
|
||||
switch ($order) {
|
||||
case 'id':
|
||||
$search->orderById(Criteria::ASC);
|
||||
break;
|
||||
case 'id_reverse':
|
||||
$search->orderById(Criteria::DESC);
|
||||
break;
|
||||
|
||||
case 'name':
|
||||
$search->addAscendingOrderByColumn('i18n_NAME');
|
||||
break;
|
||||
case 'name_reverse':
|
||||
$search->addDescendingOrderByColumn('i18n_NAME');
|
||||
break;
|
||||
|
||||
case 'code':
|
||||
$search->orderByCode(Criteria::ASC);
|
||||
break;
|
||||
case 'code_reverse':
|
||||
$search->orderByCode(Criteria::DESC);
|
||||
break;
|
||||
|
||||
case 'symbol':
|
||||
$search->orderBySymbol(Criteria::ASC);
|
||||
break;
|
||||
case 'symbol_reverse':
|
||||
$search->orderBySymbol(Criteria::DESC);
|
||||
break;
|
||||
|
||||
case 'rate':
|
||||
$search->orderByRate(Criteria::ASC);
|
||||
break;
|
||||
case 'rate_reverse':
|
||||
$search->orderByRate(Criteria::DESC);
|
||||
break;
|
||||
|
||||
case 'manual':
|
||||
$search->orderByPosition(Criteria::ASC);
|
||||
break;
|
||||
case 'manual_reverse':
|
||||
$search->orderByPosition(Criteria::DESC);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* perform search */
|
||||
$currencies = $this->search($search, $pagination);
|
||||
@@ -95,15 +158,18 @@ class Currency extends BaseI18nLoop
|
||||
$loopResult = new LoopResult();
|
||||
|
||||
foreach ($currencies as $currency) {
|
||||
|
||||
$loopResultRow = new LoopResultRow();
|
||||
$loopResultRow->set("ID", $currency->getId())
|
||||
->set("IS_TRANSLATED",$currency->getVirtualColumn('IS_TRANSLATED'))
|
||||
->set("LOCALE",$locale)
|
||||
->set("NAME",$currency->getVirtualColumn('i18n_NAME'))
|
||||
->set("ISOCODE", $currency->getCode())
|
||||
->set("SYMBOL", $currency->getSymbol())
|
||||
->set("RATE", $currency->getRate())
|
||||
->set("IS_DEFAULT", $currency->getByDefault());
|
||||
$loopResultRow
|
||||
->set("ID" , $currency->getId())
|
||||
->set("IS_TRANSLATED" , $currency->getVirtualColumn('IS_TRANSLATED'))
|
||||
->set("LOCALE" , $locale)
|
||||
->set("NAME" , $currency->getVirtualColumn('i18n_NAME'))
|
||||
->set("ISOCODE" , $currency->getCode())
|
||||
->set("SYMBOL" , $currency->getSymbol())
|
||||
->set("RATE" , $currency->getRate())
|
||||
->set("POSITION" , $currency->getPosition())
|
||||
->set("IS_DEFAULT" , $currency->getByDefault());
|
||||
|
||||
$loopResult->addRow($loopResultRow);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,60 @@ class Image extends BaseI18nLoop
|
||||
*/
|
||||
protected $possible_sources = array('category', 'product', 'folder', 'content');
|
||||
|
||||
/**
|
||||
* @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection
|
||||
*/
|
||||
protected function getArgDefinitions()
|
||||
{
|
||||
$collection = new ArgumentCollection(
|
||||
|
||||
Argument::createIntListTypeArgument('id'),
|
||||
Argument::createIntListTypeArgument('exclude'),
|
||||
new Argument(
|
||||
'order',
|
||||
new TypeCollection(
|
||||
new EnumListType(array('alpha', 'alpha-reverse', 'manual', 'manual-reverse', 'random'))
|
||||
),
|
||||
'manual'
|
||||
),
|
||||
Argument::createIntTypeArgument('lang'),
|
||||
|
||||
Argument::createIntTypeArgument('width'),
|
||||
Argument::createIntTypeArgument('height'),
|
||||
Argument::createIntTypeArgument('rotation', 0),
|
||||
Argument::createAnyTypeArgument('background_color'),
|
||||
Argument::createIntTypeArgument('quality'),
|
||||
new Argument(
|
||||
'resize_mode',
|
||||
new TypeCollection(
|
||||
new EnumType(array('crop', 'borders', 'none'))
|
||||
),
|
||||
'none'
|
||||
),
|
||||
Argument::createAnyTypeArgument('effects'),
|
||||
|
||||
Argument::createIntTypeArgument('category'),
|
||||
Argument::createIntTypeArgument('product'),
|
||||
Argument::createIntTypeArgument('folder'),
|
||||
Argument::createIntTypeArgument('content'),
|
||||
|
||||
new Argument(
|
||||
'source',
|
||||
new TypeCollection(
|
||||
new EnumType($this->possible_sources)
|
||||
)
|
||||
),
|
||||
Argument::createIntTypeArgument('source_id')
|
||||
);
|
||||
|
||||
// Add possible image sources
|
||||
foreach($this->possible_sources as $source) {
|
||||
$collection->addArgument(Argument::createIntTypeArgument($source));
|
||||
}
|
||||
|
||||
return $collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dynamically create the search query, and set the proper filter and order
|
||||
*
|
||||
@@ -244,19 +298,19 @@ class Image extends BaseI18nLoop
|
||||
$loopResultRow = new LoopResultRow();
|
||||
|
||||
$loopResultRow
|
||||
->set("ID", $result->getId())
|
||||
->set("LOCALE",$locale)
|
||||
->set("IMAGE_URL", $event->getFileUrl())
|
||||
->set("ORIGINAL_IMAGE_URL", $event->getOriginalFileUrl())
|
||||
->set("IMAGE_PATH", $event->getCacheFilepath())
|
||||
->set("ORIGINAL_IMAGE_PATH", $source_filepath)
|
||||
->set("TITLE",$folder->getVirtualColumn('i18n_TITLE'))
|
||||
->set("CHAPO", $folder->getVirtualColumn('i18n_CHAPO'))
|
||||
->set("DESCRIPTION", $folder->getVirtualColumn('i18n_DESCRIPTION'))
|
||||
->set("POSTSCRIPTUM", $folder->getVirtualColumn('i18n_POSTSCRIPTUM'))
|
||||
->set("POSITION", $result->getPosition())
|
||||
->set("OBJECT_TYPE", $object_type)
|
||||
->set("OBJECT_ID", $object_id)
|
||||
->set("ID" , $result->getId())
|
||||
->set("LOCALE" ,$locale)
|
||||
->set("IMAGE_URL" , $event->getFileUrl())
|
||||
->set("ORIGINAL_IMAGE_URL" , $event->getOriginalFileUrl())
|
||||
->set("IMAGE_PATH" , $event->getCacheFilepath())
|
||||
->set("ORIGINAL_IMAGE_PATH" , $source_filepath)
|
||||
->set("TITLE" , $result->getVirtualColumn('i18n_TITLE'))
|
||||
->set("CHAPO" , $result->getVirtualColumn('i18n_CHAPO'))
|
||||
->set("DESCRIPTION" , $result->getVirtualColumn('i18n_DESCRIPTION'))
|
||||
->set("POSTSCRIPTUM" , $result->getVirtualColumn('i18n_POSTSCRIPTUM'))
|
||||
->set("POSITION" , $result->getPosition())
|
||||
->set("OBJECT_TYPE" , $object_type)
|
||||
->set("OBJECT_ID" , $object_id)
|
||||
;
|
||||
|
||||
$loopResult->addRow($loopResultRow);
|
||||
@@ -269,58 +323,4 @@ class Image extends BaseI18nLoop
|
||||
|
||||
return $loopResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection
|
||||
*/
|
||||
protected function getArgDefinitions()
|
||||
{
|
||||
$collection = new ArgumentCollection(
|
||||
|
||||
Argument::createIntListTypeArgument('id'),
|
||||
Argument::createIntListTypeArgument('exclude'),
|
||||
new Argument(
|
||||
'order',
|
||||
new TypeCollection(
|
||||
new EnumListType(array('alpha', 'alpha-reverse', 'manual', 'manual-reverse', 'random'))
|
||||
),
|
||||
'manual'
|
||||
),
|
||||
Argument::createIntTypeArgument('lang'),
|
||||
|
||||
Argument::createIntTypeArgument('width'),
|
||||
Argument::createIntTypeArgument('height'),
|
||||
Argument::createIntTypeArgument('rotation', 0),
|
||||
Argument::createAnyTypeArgument('background_color'),
|
||||
Argument::createIntTypeArgument('quality'),
|
||||
new Argument(
|
||||
'resize_mode',
|
||||
new TypeCollection(
|
||||
new EnumType(array('crop', 'borders', 'none'))
|
||||
),
|
||||
'none'
|
||||
),
|
||||
Argument::createAnyTypeArgument('effects'),
|
||||
|
||||
Argument::createIntTypeArgument('category'),
|
||||
Argument::createIntTypeArgument('product'),
|
||||
Argument::createIntTypeArgument('folder'),
|
||||
Argument::createIntTypeArgument('content'),
|
||||
|
||||
new Argument(
|
||||
'source',
|
||||
new TypeCollection(
|
||||
new EnumType($this->possible_sources)
|
||||
)
|
||||
),
|
||||
Argument::createIntTypeArgument('source_id')
|
||||
);
|
||||
|
||||
// Add possible image sources
|
||||
foreach($this->possible_sources as $source) {
|
||||
$collection->addArgument(Argument::createIntTypeArgument($source));
|
||||
}
|
||||
|
||||
return $collection;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?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\Core\Template\Smarty\Exception;
|
||||
|
||||
|
||||
/**
|
||||
* Class SmartyPluginException
|
||||
* @package Thelia\Core\Template\Smarty\Exception
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class SmartyPluginException extends \SmartyException
|
||||
{}
|
||||
154
core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php
Normal file
154
core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?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\Core\Template\Smarty\Plugins;
|
||||
|
||||
use Thelia\Core\HttpFoundation\Request;
|
||||
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
|
||||
use Thelia\Core\Template\Smarty\Exception\SmartyPluginException;
|
||||
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
|
||||
|
||||
/**
|
||||
*
|
||||
* format_date and format_date smarty function.
|
||||
*
|
||||
* Class Format
|
||||
* @package Thelia\Core\Template\Smarty\Plugins
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class Format extends AbstractSmartyPlugin
|
||||
{
|
||||
protected $request;
|
||||
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
* return date in expected format
|
||||
*
|
||||
* available parameters :
|
||||
* date => DateTime object (mandatory)
|
||||
* format => expected format
|
||||
* output => list of default system format. Values available :
|
||||
* date => date format
|
||||
* time => time format
|
||||
* datetime => datetime format (default)
|
||||
*
|
||||
* ex :
|
||||
* {format_date date=$dateTimeObject format="Y-m-d H:i:s"} will output the format with specific format
|
||||
* {format_date date=$dateTimeObject output="date"} will output the date using the default date system format
|
||||
* {format_date date=$dateTimeObject} will output with the default datetime system format
|
||||
*
|
||||
* @param array $params
|
||||
* @param null $template
|
||||
* @throws \Thelia\Core\Template\Smarty\Exception\SmartyPluginException
|
||||
* @return string
|
||||
*/
|
||||
public function formatDate($params, $template = null)
|
||||
{
|
||||
|
||||
if (array_key_exists("date", $params) === false) {
|
||||
throw new SmartyPluginException("date is a mandatory parameter in format_date function");
|
||||
}
|
||||
|
||||
$date = $params["date"];
|
||||
|
||||
if(!$date instanceof \DateTime) {
|
||||
return "";
|
||||
}
|
||||
|
||||
$format = null;
|
||||
$output = array_key_exists("output", $params) ? $params["output"] : null;
|
||||
|
||||
if (array_key_exists("format", $params)) {
|
||||
$format = $params["format"];
|
||||
} else {
|
||||
$session = $this->request->getSession();
|
||||
$lang = $session->getLang();
|
||||
|
||||
if($lang) {
|
||||
switch ($output) {
|
||||
case "date" :
|
||||
$format = $lang->getDateFormat();
|
||||
break;
|
||||
case "time" :
|
||||
$format = $lang->getTimeFormat();
|
||||
break;
|
||||
default:
|
||||
case "datetime" :
|
||||
$format = $lang->getDateTimeFormat();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $date->format($format);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* display numbers in expected format
|
||||
*
|
||||
* available parameters :
|
||||
* number => int or float number
|
||||
* decimals => how many decimals format expected
|
||||
* dec_point => separator for the decimal point
|
||||
* thousands_sep => thousands separator
|
||||
*
|
||||
* ex : {format_number number="1246.12" decimals="1" dec_point="," thousands_sep=" "} will output "1 246,1"
|
||||
*
|
||||
* @param $params
|
||||
* @param null $template
|
||||
* @throws \Thelia\Core\Template\Smarty\Exception\SmartyPluginException
|
||||
* @return string the expected number formatted
|
||||
*/
|
||||
public function formatNumber($params, $template = null)
|
||||
{
|
||||
if (array_key_exists("number", $params) === false) {
|
||||
throw new SmartyPluginException("number is a mandatory parameter in format_number function");
|
||||
}
|
||||
|
||||
$lang = $this->request->getSession()->getLang();
|
||||
|
||||
$number = $params["number"];
|
||||
$decimals = array_key_exists("decimals", $params) ? $params["decimals"] : $lang->getDecimals();
|
||||
$decPoint = array_key_exists("dec_point", $params) ? $params["dec_point"] : $lang->getDecimalSeparator();
|
||||
$thousandsSep = array_key_exists("thousands_sep", $params) ? $params["thousands_sep"] : $lang->getThousandsSeparator();
|
||||
|
||||
return number_format($number, $decimals, $decPoint, $thousandsSep);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return an array of SmartyPluginDescriptor
|
||||
*/
|
||||
public function getPluginDescriptors()
|
||||
{
|
||||
return array(
|
||||
new SmartyPluginDescriptor("function", "format_date", $this, "formatDate"),
|
||||
new SmartyPluginDescriptor("function", "format_number", $this, "formatNumber")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ class TheliaHttpKernel extends HttpKernel
|
||||
|
||||
if ($lang) {
|
||||
$request->getSession()
|
||||
->setLang($lang->getCode())
|
||||
->setLang($lang)
|
||||
->setLocale($lang->getLocale())
|
||||
;
|
||||
}
|
||||
|
||||
@@ -47,109 +47,92 @@ class CouponCreationForm extends BaseForm
|
||||
{
|
||||
$this->formBuilder
|
||||
->add(
|
||||
"code",
|
||||
"text",
|
||||
'code',
|
||||
'text',
|
||||
array(
|
||||
"constraints" => array(
|
||||
'constraints' => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
"type",
|
||||
"text",
|
||||
'title',
|
||||
'text',
|
||||
array(
|
||||
"constraints" => array(
|
||||
'constraints' => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
"title",
|
||||
"text",
|
||||
'shortDescription',
|
||||
'text',
|
||||
array(
|
||||
"constraints" => array(
|
||||
'invalid_message' => 'test',
|
||||
'constraints' => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
"shortDescription",
|
||||
"text",
|
||||
'description',
|
||||
'textarea',
|
||||
array(
|
||||
"constraints" => array(
|
||||
'invalid_message' => 'test',
|
||||
'constraints' => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
"description",
|
||||
"text",
|
||||
'effect',
|
||||
'text',
|
||||
array(
|
||||
"constraints" => array(
|
||||
'invalid_message' => 'test',
|
||||
'constraints' => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
"amount",
|
||||
"text",
|
||||
'amount',
|
||||
'money',
|
||||
array()
|
||||
)
|
||||
->add(
|
||||
'isEnabled',
|
||||
'checkbox',
|
||||
array()
|
||||
)
|
||||
->add(
|
||||
'expirationDate',
|
||||
'text',
|
||||
array(
|
||||
"constraints" => array(
|
||||
'constraints' => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
"isEnabled",
|
||||
"text",
|
||||
array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
'isCumulative',
|
||||
'checkbox',
|
||||
array()
|
||||
)
|
||||
->add(
|
||||
"expirationDate",
|
||||
"text",
|
||||
array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
'isRemovingPostage',
|
||||
'checkbox',
|
||||
array()
|
||||
)
|
||||
->add(
|
||||
"isCumulative",
|
||||
"text",
|
||||
array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
'isAvailableOnSpecialOffers',
|
||||
'checkbox',
|
||||
array()
|
||||
)
|
||||
->add(
|
||||
"isRemovingPostage",
|
||||
"text",
|
||||
'maxUsage',
|
||||
'text',
|
||||
array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
"maxUsage",
|
||||
"text",
|
||||
array(
|
||||
"constraints" => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
)
|
||||
->add(
|
||||
"isAvailableOnSpecialOffers",
|
||||
"text",
|
||||
array(
|
||||
"constraints" => array(
|
||||
'constraints' => array(
|
||||
new NotBlank()
|
||||
)
|
||||
)
|
||||
@@ -163,6 +146,6 @@ class CouponCreationForm extends BaseForm
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_coupon_creation";
|
||||
return 'thelia_coupon_creation';
|
||||
}
|
||||
}
|
||||
|
||||
65
core/lib/Thelia/Form/CurrencyCreationForm.php
Normal file
65
core/lib/Thelia/Form/CurrencyCreationForm.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?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\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
use Thelia\Model\CurrencyQuery;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class CurrencyCreationForm extends BaseForm
|
||||
{
|
||||
protected function buildForm($change_mode = false)
|
||||
{
|
||||
$name_constraints = array(new Constraints\NotBlank());
|
||||
|
||||
if (!$change_mode) {
|
||||
$name_constraints[] = new Constraints\Callback(array(
|
||||
"methods" => array(array($this, "checkDuplicateName"))
|
||||
));
|
||||
}
|
||||
|
||||
$this->formBuilder
|
||||
->add("name" , "text" , array("constraints" => array($name_constraints)))
|
||||
->add("locale" , "text" , array())
|
||||
->add("symbol" , "text" , array("constraints" => array(new NotBlank())))
|
||||
->add("rate" , "text" , array("constraints" => array(new NotBlank())))
|
||||
->add("code" , "text" , array("constraints" => array(new NotBlank())))
|
||||
;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_currency_creation";
|
||||
}
|
||||
|
||||
public function checkDuplicateName($value, ExecutionContextInterface $context)
|
||||
{
|
||||
$currency = CurrencyQuery::create()->findOneByName($value);
|
||||
|
||||
if ($currency) {
|
||||
$context->addViolation(sprintf("A currency with name \"%s\" already exists.", $value));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
45
core/lib/Thelia/Form/CurrencyModificationForm.php
Normal file
45
core/lib/Thelia/Form/CurrencyModificationForm.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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\Form;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Thelia\Model\LangQuery;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Symfony\Component\Validator\Constraints\GreaterThan;
|
||||
|
||||
class CurrencyModificationForm extends CurrencyCreationForm
|
||||
{
|
||||
protected function buildForm()
|
||||
{
|
||||
parent::buildForm(true);
|
||||
|
||||
$this->formBuilder
|
||||
->add("id" , "hidden", array("constraints" => array(new GreaterThan(array('value' => 0)))))
|
||||
;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return "thelia_currency_modification";
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,65 @@
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\Currency as BaseCurrency;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Thelia\Core\Event\CurrencyEvent;
|
||||
|
||||
class Currency extends BaseCurrency {
|
||||
|
||||
}
|
||||
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function preInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_CREATECURRENCY, new CurrencyEvent($this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function postInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_CREATECURRENCY, new CurrencyEvent($this));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function preUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_CHANGECURRENCY, new CurrencyEvent($this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function postUpdate(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_CHANGECURRENCY, new CurrencyEvent($this));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function preDelete(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::BEFORE_DELETECURRENCY, new CurrencyEvent($this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function postDelete(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_DELETECURRENCY, new CurrencyEvent($this));
|
||||
}
|
||||
}
|
||||
@@ -24,15 +24,33 @@ class Lang extends BaseLang {
|
||||
return $default_lang;
|
||||
}
|
||||
|
||||
public function getDateFormat() {
|
||||
public function getDateFormat()
|
||||
{
|
||||
return "d/m/Y";
|
||||
}
|
||||
|
||||
public function getTimeFormat() {
|
||||
public function getTimeFormat()
|
||||
{
|
||||
return "H:i:s";
|
||||
}
|
||||
|
||||
public function getDateTimeFormat() {
|
||||
public function getDateTimeFormat()
|
||||
{
|
||||
return "d/m/Y H:i:s";
|
||||
}
|
||||
|
||||
public function getDecimalSeparator()
|
||||
{
|
||||
return ".";
|
||||
}
|
||||
|
||||
public function getThousandsSeparator()
|
||||
{
|
||||
return " ";
|
||||
}
|
||||
|
||||
public function getDecimals()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
<?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\Tests\Core\Smarty\Plugins;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
|
||||
use Thelia\Core\HttpFoundation\Request;
|
||||
use Thelia\Core\HttpFoundation\Session\Session;
|
||||
use Thelia\Core\Template\Smarty\Plugins\Format;
|
||||
|
||||
/**
|
||||
* @coversDefaultClass \Thelia\Core\Template\Smarty\Plugins\Format
|
||||
*/
|
||||
class FormatTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
protected $request;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new Request();
|
||||
|
||||
$this->request->setSession(new Session(new MockArraySessionStorage()));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* test formatDate method with expected format
|
||||
*
|
||||
* @covers ::formatDate
|
||||
*/
|
||||
public function testFormatDateWithSpecificFormat()
|
||||
{
|
||||
$dateTime = new \DateTime();
|
||||
$format = "Y-m-d H:i:s";
|
||||
|
||||
$formatClass = new Format($this->request);
|
||||
|
||||
$render = $formatClass->formatDate(array(
|
||||
"date" => $dateTime,
|
||||
"format" => $format
|
||||
));
|
||||
|
||||
$this->assertEquals($dateTime->format($format), $render);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* test formatDate method with date default format
|
||||
*
|
||||
* @covers ::formatDate
|
||||
*/
|
||||
public function testFormatDateWithDefaultSessionParam()
|
||||
{
|
||||
$dateTime = new \DateTime();
|
||||
|
||||
$langMock = $this->getLangMock();
|
||||
$this->request->getSession()->setLang($langMock);
|
||||
|
||||
$formatClass = new Format($this->request);
|
||||
|
||||
$render = $formatClass->formatDate(array("date" => $dateTime));
|
||||
|
||||
$this->assertEquals($dateTime->format("Y-m-d H:i:s"), $render);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* test formatDate method with time default format
|
||||
*
|
||||
* @covers ::formatDate
|
||||
*/
|
||||
public function testFormatDateWithDateSessionParam()
|
||||
{
|
||||
$dateTime = new \DateTime();
|
||||
|
||||
$langMock = $this->getLangMock();
|
||||
$this->request->getSession()->setLang($langMock);
|
||||
|
||||
$formatClass = new Format($this->request);
|
||||
|
||||
$render = $formatClass->formatDate(array(
|
||||
"date" => $dateTime,
|
||||
"output" => "date"
|
||||
));
|
||||
|
||||
$this->assertEquals($dateTime->format("Y-m-d"), $render);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* test formatDate method with datetime default format
|
||||
*
|
||||
* @covers ::formatDate
|
||||
*/
|
||||
public function testFormatDateWithTimeSessionParam()
|
||||
{
|
||||
$dateTime = new \DateTime();
|
||||
|
||||
$langMock = $this->getLangMock();
|
||||
$this->request->getSession()->setLang($langMock);
|
||||
|
||||
$formatClass = new Format($this->request);
|
||||
|
||||
$render = $formatClass->formatDate(array(
|
||||
"date" => $dateTime,
|
||||
"output" => "time"
|
||||
));
|
||||
|
||||
$this->assertEquals($dateTime->format("H:i:s"), $render);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* test formatDate method without output or expected format. datetime format must be return
|
||||
*
|
||||
* @covers ::formatDate
|
||||
*/
|
||||
public function testFormatDateWithDateTimeSessionParam()
|
||||
{
|
||||
$dateTime = new \DateTime();
|
||||
|
||||
$langMock = $this->getLangMock();
|
||||
$this->request->getSession()->setLang($langMock);
|
||||
|
||||
$formatClass = new Format($this->request);
|
||||
|
||||
$render = $formatClass->formatDate(array(
|
||||
"date" => $dateTime,
|
||||
"output" => "datetime"
|
||||
));
|
||||
|
||||
$this->assertEquals($dateTime->format("Y-m-d H:i:s"), $render);
|
||||
}
|
||||
|
||||
/**
|
||||
* test formatDate without mandatory parameters
|
||||
*
|
||||
* @covers ::formatDate
|
||||
* @expectedException \Thelia\Core\Template\Smarty\Exception\SmartyPluginException
|
||||
*/
|
||||
public function testFormatDateWithoutDate()
|
||||
{
|
||||
$dateTime = new \DateTime();
|
||||
|
||||
$formatClass = new Format($this->request);
|
||||
|
||||
$render = $formatClass->formatDate(array());
|
||||
|
||||
$this->assertEquals($dateTime->format("Y-m-d H:i:s"), $render);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* test formatNumber without mandatory parameters
|
||||
*
|
||||
* @covers ::formatNumber
|
||||
* @expectedException \Thelia\Core\Template\Smarty\Exception\SmartyPluginException
|
||||
*/
|
||||
public function testFormatNumberWithoutParams()
|
||||
{
|
||||
$formatClass = new Format($this->request);
|
||||
|
||||
$render = $formatClass->formatNumber(array());
|
||||
}
|
||||
|
||||
/**
|
||||
* test formatDate specifying all parameters
|
||||
*
|
||||
* @covers ::formatNumber
|
||||
*/
|
||||
public function testFormatNumberWithAllParams()
|
||||
{
|
||||
$formatClass = new Format($this->request);
|
||||
|
||||
$number = 1256.12;
|
||||
$decimals = 1;
|
||||
$decPoint = ",";
|
||||
$thousandsSep = " ";
|
||||
|
||||
$render = $formatClass->formatNumber(array(
|
||||
"number" => $number,
|
||||
"decimals" => $decimals,
|
||||
"dec_point" => $decPoint,
|
||||
"thousands_sep" => $thousandsSep
|
||||
));
|
||||
|
||||
$this->assertEquals($render, "1 256,1");
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers ::formatNumber
|
||||
*/
|
||||
public function testFormatNumberWithDefaultParameters()
|
||||
{
|
||||
$number = 1234.56;
|
||||
$langMock = $this->getLangMock();
|
||||
$this->request->getSession()->setLang($langMock);
|
||||
|
||||
$formatClass = new Format($this->request);
|
||||
|
||||
$render = $formatClass->formatNumber(array(
|
||||
"number" => $number
|
||||
));
|
||||
|
||||
$this->assertEquals( $render, number_format($number, 2, ",", " "));
|
||||
}
|
||||
|
||||
/**
|
||||
* create a mock for Thelia\Model\Lang class
|
||||
* @return \Thelia\Model\Lang instance
|
||||
*/
|
||||
public function getLangMock()
|
||||
{
|
||||
$mock = $this->getMock(
|
||||
"Thelia\Model\Lang",
|
||||
array(
|
||||
"getDateFormat",
|
||||
"getTimeFormat",
|
||||
"getDateTimeFormat",
|
||||
"getDecimalSeparator",
|
||||
"getThousandsSeparator",
|
||||
"getDecimals"
|
||||
)
|
||||
);
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method("getDateFormat")
|
||||
->will($this->returnValue("Y-m-d"));
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method("getTimeFormat")
|
||||
->will($this->returnValue("H:i:s"));
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method("getDateTimeFormat")
|
||||
->will($this->returnValue("Y-m-d H:i:s"));
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method("getDecimals")
|
||||
->will($this->returnValue(2));
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method("getDecimalSeparator")
|
||||
->will($this->returnValue(","));
|
||||
|
||||
$mock->expects($this->any())
|
||||
->method("getThousandsSeparator")
|
||||
->will($this->returnValue(" "));
|
||||
|
||||
return $mock;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,9 @@
|
||||
{$page_title={intl l='Page not found'}}
|
||||
{extends file="general_error.html"}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{block name="page-title"}{intl l='Page not found'}{/block}
|
||||
{block name="content-title"}{intl l='Page not found'}{/block}
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
<h1>{intl l="Oops! An Error Occurred"}</h1>
|
||||
<h2>{intl l='The server returned a "404 Not Found"'}</h2>
|
||||
<p>{intl l='The page you\'ve requested was not found. Please check the page address, and try again.'}</p>
|
||||
</div>
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{block name="error-message"}
|
||||
<h2>{intl l='The server returned a "404 Not Found"'}</h2>
|
||||
<p>{intl l='The page you\'ve requested was not found. Please check the page address, and try again.'}</p>
|
||||
{/block}
|
||||
223
templates/admin/default/admin-layout.tpl
Normal file
223
templates/admin/default/admin-layout.tpl
Normal file
@@ -0,0 +1,223 @@
|
||||
{* -- By default, check admin login ----------------------------------------- *}
|
||||
|
||||
{block name="check-auth"}
|
||||
{check_auth roles="ADMIN" permissions="{block name="check-permissions"}{/block}" login_tpl="/admin/login"}
|
||||
{/block}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{$lang_code}">
|
||||
<head>
|
||||
<title>{block name="page-title"}Default Page Title{/block} - {intl l='Thelia Back Office'}</title>
|
||||
|
||||
{images file='assets/img/favicon.ico'}<link rel="shortcut icon" href="{$asset_url}" />{/images}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
{block name="meta"}{/block}
|
||||
|
||||
{* -- Bootstrap CSS section --------------------------------------------- *}
|
||||
|
||||
{block name="before-bootstrap-css"}{/block}
|
||||
|
||||
{stylesheets file='assets/bootstrap/css/bootstrap.css' filters='cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{stylesheets file='assets/bootstrap/css/bootstrap-responsive.css' filters='cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{block name="after-bootstrap-css"}{/block}
|
||||
|
||||
{* -- Admin CSS section ------------------------------------------------- *}
|
||||
|
||||
{block name="before-admin-css"}{/block}
|
||||
|
||||
{stylesheets file='assets/css/*' filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{block name="after-admin-css"}{/block}
|
||||
|
||||
{* Modules css are included here *}
|
||||
|
||||
{module_include location='head_css'}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{* display top bar only if admin is connected *}
|
||||
|
||||
{loop name="top-bar-auth" type="auth" roles="ADMIN"}
|
||||
|
||||
{* -- Brand bar section ------------------------------------------------- *}
|
||||
|
||||
{module_include location='before_topbar'}
|
||||
|
||||
<div class="topbar">
|
||||
<div class="container">
|
||||
|
||||
<div class="version-info">{intl l='Version %ver' ver="{$THELIA_VERSION}"}</div>
|
||||
|
||||
{module_include location='inside_topbar'}
|
||||
|
||||
<div class="user-info">
|
||||
<a class="profile" href="{url path='admin/edit_profile'}">{admin attr="firstname"} {admin attr="lastname"}</a>
|
||||
<a class="logout" href="{url path='admin/logout'}" title="{intl l='Close administation session'}">{intl l="Logout"}</a></div>
|
||||
|
||||
{loop name="top-bar-search" type="auth" roles="ADMIN" permissions="admin.search"}
|
||||
<form class="form-search pull-right" action="{url path='/admin/search'}">
|
||||
<div class="control-group">
|
||||
<div class="input-append">
|
||||
<input type="text" class="input-medium search-query" id="search_term" name="search_term" placeholder="{intl l='Search'}" />
|
||||
<button class="btn"><i class="icon-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/loop}
|
||||
|
||||
<div class="view-shop"><a href="{navigate to="index"}" title="{intl l='View site'}" target="_blank"><i class="icon-white icon-eye-open"></i> {intl l="View shop"}</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='after_topbar'}
|
||||
|
||||
{* -- Top menu section -------------------------------------------------- *}
|
||||
|
||||
{module_include location='before_top_menu'}
|
||||
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<div class="nav-collapse">
|
||||
|
||||
<ul class="nav">
|
||||
|
||||
<li class="{if $admin_current_location == 'home'}active{/if}" id="home_menu">
|
||||
<a href="{url path='/admin/home'}">{intl l="Home"}</a>
|
||||
</li>
|
||||
|
||||
{loop name="menu-auth-customer" type="auth" roles="ADMIN" permissions="admin.customers.view"}
|
||||
<li class="{if $admin_current_location == 'customer'}active{/if}" id="customers_menu">
|
||||
<a href="{url path='/admin/customers'}">{intl l="Customers"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-order" type="auth" roles="ADMIN" permissions="admin.orders.view"}
|
||||
<li class="dropdown {if $admin_current_location == 'customer'}active{/if}" id="orders_menu" data-toggle="dropdown">
|
||||
|
||||
<a href="#">{intl l="Orders"} <span class="caret"></span></a>
|
||||
|
||||
<ul class="dropdown-menu config_menu" role="menu">
|
||||
|
||||
<li role="menuitem"><a data-target="{url path='admin/orders'}" href="{url path='admin/orders'}">
|
||||
{intl l="All orders"}
|
||||
<span class="badge badge-important">{count type="order"}</span></a>
|
||||
</li>
|
||||
|
||||
{loop name="order-status-list" type="order-status"}
|
||||
<li role="menuitem">
|
||||
<a data-target="{url path='admin/orders/$LABEL'}" href="{url path='admin/orders/$LABEL'}">
|
||||
{$LABEL} <span class="badge badge-important">{count type="order" status="{$ID}"}</span>
|
||||
</a>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-catalog" type="auth" roles="ADMIN" permissions="admin.catalog.view"}
|
||||
<li class="{if $admin_current_location == 'catalog'}active{/if}" id="catalog_menu">
|
||||
<a href="{url path='/admin/catalog'}">{intl l="Catalog"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-content" type="auth" roles="ADMIN" permissions="admin.content.view"}
|
||||
<li class="{if $admin_current_location == 'content'}active{/if}" id="content_menu">
|
||||
<a href="{url path='/admin/content'}">{intl l="Content"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-discount" type="auth" roles="ADMIN" permissions="admin.discount.view"}
|
||||
<li class="{if $admin_current_location == 'discount'}active{/if}" id="discount_menu">
|
||||
<a href="{url path='/admin/discount'}">{intl l="Discount"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-config" type="auth" roles="ADMIN" permissions="admin.config.view"}
|
||||
<li class="{if $admin_current_location == 'configuration'}active{/if}" id="config_menu">
|
||||
<a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-modules" type="auth" roles="ADMIN" permissions="admin.modules.view"}
|
||||
<li class="{if $admin_current_location == 'modules'}active{/if}" id="modules_menu">
|
||||
<a href="{url path='/admin/modules'}">{intl l="Modules"}</a>
|
||||
</li>
|
||||
|
||||
{module_include location='in_top_menu_items'}
|
||||
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='after_top_menu'}
|
||||
|
||||
{/loop}
|
||||
|
||||
{* A basic brandbar is displayed if user is not connected *}
|
||||
|
||||
{elseloop rel="top-bar-auth"}
|
||||
<div class="brandbar brandbar-wide container">
|
||||
<a class="brand" href="{url path='/admin'}">{images file='assets/img/logo-thelia-34px.png'}<img src="{$asset_url}" alt="{intl l='Thelia, solution e-commerce libre'}" />{/images}</a>
|
||||
</div>
|
||||
{/elseloop}
|
||||
|
||||
{* -- Main page content section ----------------------------------------- *}
|
||||
|
||||
{block name="main-content"}Put here the content of the template{/block}
|
||||
|
||||
{* -- Footer section ---------------------------------------------------- *}
|
||||
|
||||
{module_include location='before_footer'}
|
||||
|
||||
<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>
|
||||
|
||||
{module_include location='after_footer'}
|
||||
|
||||
|
||||
{* -- Javascript section ------------------------------------------------ *}
|
||||
|
||||
{block name="before-javascript-include"}{/block}
|
||||
|
||||
{javascripts file='assets/js/jquery.min.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/bootstrap/js/bootstrap.min.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{block name="after-javascript-include"}{/block}
|
||||
|
||||
{block name="javascript-initialization"}{/block}
|
||||
|
||||
{* Modules scripts are included now *}
|
||||
{module_include location='footer_js'}
|
||||
</body>
|
||||
</html>
|
||||
@@ -629,6 +629,10 @@ form .info .input-append .add-on {
|
||||
.actions {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.form {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Reduce bottom margin of admin tabs.
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
{check_auth roles="ADMIN" permissions="admin.catalog.view" login_tpl="/admin/login"}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{$page_title={intl l='Catalog'}}
|
||||
{block name="page-title"}{intl l='Catalog'}{/block}
|
||||
|
||||
{$thelia_page_css_file = "assets/bootstrap-editable/css/bootstrap-editable.css"}
|
||||
{block name="check-permissions"}admin.catalog.view{/block}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{block name="after-admin-css"}
|
||||
{stylesheets file='assets/bootstrap-editable/css/bootstrap-editable.css' filters='cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="catalog">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
@@ -256,13 +261,15 @@
|
||||
|
||||
{include file="includes/add-category-dialog.html"}
|
||||
{include file="includes/delete-category-dialog.html"}
|
||||
{/block}
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
{javascripts file='assets/bootstrap-editable/js/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{block name="after-javascript-include"}
|
||||
{javascripts file='assets/bootstrap-editable/js/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@@ -327,5 +334,4 @@ $(function() {
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{/block}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
{check_auth roles="ADMIN" permissions="admin.configuration.view" login_tpl="/admin/login"}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{$page_title={intl l='Configuration'}}
|
||||
{block name="page-title"}{intl l='Configuration'}{/block}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{block name="check-permissions"}admin.configuration.view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="configuration">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
@@ -168,7 +169,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{/block}
|
||||
41
templates/admin/default/coupon-create.html
Executable file
41
templates/admin/default/coupon-create.html
Executable file
@@ -0,0 +1,41 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
{block name="check-permissions"}admin.coupon.create{/block}
|
||||
{block name="page-title"}{intl l='Create coupon'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<section id="wrapper" class="container">
|
||||
|
||||
<nav>
|
||||
<ul class="breadcrumb">
|
||||
{include file="includes/coupon_breadcrumb.html"}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Coupons : <small>Add a coupon</small></h1>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.coupon.creation"}
|
||||
{include file='coupon/form.html' formAction={url path={$formAction}}}
|
||||
{/form}
|
||||
|
||||
</section> <!-- #wrapper -->
|
||||
{/block}
|
||||
|
||||
{include file='includes/confirmation-modal.html'}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
{javascripts file='assets/bootstrap-datepicker/js/bootstrap-datepicker.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(function($){
|
||||
miniBrowser(0, '/test_to_remove/datas_coupon_edit.json');
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
41
templates/admin/default/coupon-edit.html
Executable file
41
templates/admin/default/coupon-edit.html
Executable file
@@ -0,0 +1,41 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
{block name="check-permissions"}admin.coupon.edit{/block}
|
||||
{block name="page-title"}{intl l='Edit coupon'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<section id="wrapper" class="container">
|
||||
|
||||
<nav>
|
||||
<ul class="breadcrumb">
|
||||
{include file="includes/coupon_breadcrumb.html"}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Coupons : <small>Add a coupon</small></h1>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.coupon.edit"}
|
||||
{include file='coupon/form.html' formAction={url path={$formAction}} form=$form}
|
||||
{/form}
|
||||
|
||||
</section> <!-- #wrapper -->
|
||||
{/block}
|
||||
|
||||
{include file='includes/confirmation-modal.html'}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
{javascripts file='assets/bootstrap-datepicker/js/bootstrap-datepicker.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(function($){
|
||||
miniBrowser(0, '/test_to_remove/datas_coupon_edit.json');
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
@@ -1,12 +1,8 @@
|
||||
{check_auth context="admin" roles="ADMIN" permissions="admin.coupon.view" login_tpl="/admin/login"}
|
||||
|
||||
{$page_title={intl l='Coupon'}}
|
||||
|
||||
{$thelia_page_css_file = "assets/bootstrap-editable/css/bootstrap-editable.css"}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
|
||||
{extends file="admin-layout.tpl"}
|
||||
{block name="check-permissions"}admin.coupon.view{/block}
|
||||
{block name="page-title"}{intl l='Coupons'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<section id="wrapper" class="container">
|
||||
|
||||
<nav>
|
||||
@@ -142,64 +138,41 @@
|
||||
</section>
|
||||
|
||||
</section> <!-- #wrapper -->
|
||||
{/block}
|
||||
|
||||
<aside id="disable" class="modal hide fade" role="dialog">
|
||||
<div class="modal-header">
|
||||
<h3>Confirmation</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Do you really want to disable this element?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-inverse" data-dismiss="modal">Cancel</button>
|
||||
<a href="#" class="btn btn-success" data-confirm="confirm">Confirm</a>
|
||||
</div>
|
||||
</aside> <!-- #disable / Disable confirmation -->
|
||||
{include file='includes/confirmation-modal.html' id="disable" message="{intl l='Do you really want to disable this element ?'}"}
|
||||
{include file='includes/confirmation-modal.html' id="enable" message="{intl l='Do you really want to enable this element ?'}"}
|
||||
|
||||
<aside id="enable" class="modal hide fade" role="dialog">
|
||||
<div class="modal-header">
|
||||
<h3>Confirmation</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Do you really want to enable this element?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-inverse" data-dismiss="modal">Cancel</button>
|
||||
<a href="#" class="btn btn-success" data-confirm="confirm">Confirm</a>
|
||||
</div>
|
||||
</aside> <!-- #enable / Enable confirmation -->
|
||||
{block name="javascript-initialization"}
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
{stylesheets file='../assets/css/jqueryui/custom-theme/*' filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
|
||||
|
||||
{stylesheets file='../assets/css/jqueryui/custom-theme/*' filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
{javascripts file='../assets/bootstrap-editable/js/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
|
||||
{javascripts file='../assets/js/tablesorter/jquery.tablesorter.min.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../assets/bootstrap-editable/js/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{javascripts file='../assets/js/tablesorter/jquery.metadata.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../assets/js/tablesorter/jquery.tablesorter.min.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{javascripts file='../assets/js/tablesorter/jquery.tablesorter.widgets.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../assets/js/tablesorter/jquery.metadata.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{javascripts file='../assets/js/tablesorter/jquery.tablesorter.widgets-filter-formatter.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../assets/js/tablesorter/jquery.tablesorter.widgets.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../assets/js/tablesorter/jquery.tablesorter.widgets-filter-formatter.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{javascripts file='../assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{/block}
|
||||
@@ -1,11 +1,8 @@
|
||||
{check_auth context="admin" roles="ADMIN" permissions="admin.coupon.view" login_tpl="/admin/login"}
|
||||
|
||||
{$page_title={intl l='Coupon'}}
|
||||
|
||||
{$thelia_page_css_file = "assets/bootstrap-editable/css/bootstrap-editable.css"}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{extends file="admin-layout.tpl"}
|
||||
{block name="check-permissions"}admin.coupon.view{/block}
|
||||
{block name="page-title"}{intl l='Coupon'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<section id="wrapper" class="container">
|
||||
|
||||
<nav>
|
||||
@@ -113,31 +110,17 @@
|
||||
{/loop}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
</section> <!-- #wrapper -->
|
||||
{/block}
|
||||
|
||||
<aside id="enable" class="modal hide fade" role="dialog">
|
||||
<div class="modal-header">
|
||||
<h3>Confirmation</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Do you really want to enable this element?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-inverse" data-dismiss="modal">Cancel</button>
|
||||
<a href="#" class="btn btn-success" data-confirm="confirm">Confirm</a>
|
||||
</div>
|
||||
</aside> <!-- #enable / Enable confirmation -->
|
||||
{include file='includes/confirmation-modal.html'}
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
{block name="javascript-initialization"}
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../assets/bootstrap-editable/js/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{javascripts file='assets/bootstrap-editable/js/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{/block}
|
||||
@@ -1,5 +0,0 @@
|
||||
{check_auth context="admin" roles="ADMIN" permissions="admin.coupon.create" login_tpl="/admin/login"}
|
||||
|
||||
{$page_title={intl l='Coupon creation'}}
|
||||
|
||||
{include file='coupon/includes/edit.html'}
|
||||
300
templates/admin/default/coupon/form.html
Normal file
300
templates/admin/default/coupon/form.html
Normal file
@@ -0,0 +1,300 @@
|
||||
{$thelia_page_css_file = "assets/bootstrap-editable/css/bootstrap-editable.css"}
|
||||
{include file='includes/notifications.html' message=$general_error}
|
||||
<form action="{$formAction}" {form_enctype form=$form} method="POST" >
|
||||
<section class="row-fluid">
|
||||
<div class="span12 general-block-decorator">
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
<div class="span4">
|
||||
<div class="control-group">
|
||||
<label for="code">Code :</label>
|
||||
{form_field form=$form field='code'}
|
||||
<input id="code" type="text" name="{$name}" value="{$value}" placeholder="code">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="title">Title :</label>
|
||||
{form_field form=$form field='title'}
|
||||
<input id="title" type="text" name="{$name}" value="{$value}" placeholder="title">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="enabled" class="checkbox">
|
||||
{form_field form=$form field='isEnabled'}
|
||||
<input id="enabled" type="checkbox" name="{$name}" {if $value}checked{/if} >
|
||||
{if $error}{$message}{/if}
|
||||
value = {$value}
|
||||
{/form_field}
|
||||
Is enabled ?
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="available-on-special-offers" class="checkbox">
|
||||
{form_field form=$form field='isAvailableOnSpecialOffers'}
|
||||
<input id="available-on-special-offers" type="checkbox" name="{$name}" {if $value}checked{/if} >
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
Is available on special offers ?
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="cumulative" class="checkbox">
|
||||
{form_field form=$form field='isCumulative'}
|
||||
<input id="cumulative" type="checkbox" name="{$name}" {if $value}checked{/if} >
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
Is cumulative ?
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="renoving-postage" class="checkbox">
|
||||
{form_field form=$form field='isRemovingPostage'}
|
||||
<input id="renoving-postage" type="checkbox" name="{$name}" {if $value}checked{/if} >
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
Is removing postage ?
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="expiration-date">Expiration date :</label>
|
||||
<div class="input-append date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">
|
||||
{form_field form=$form field='expirationDate'}
|
||||
<input type="text" id="expiration-date" name="{$name}" value="{$value}">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
<span class="add-on"><span class="icon-th"></span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="max-usage">Max usage :</label>
|
||||
<label for="is-unlimited" class="checkbox">
|
||||
<input id="is-unlimited" type="checkbox" name="{$name}" {if $value}checked{/if} >
|
||||
Is unlimited ?
|
||||
</label>
|
||||
{form_field form=$form field='maxUsage'}
|
||||
<input id="max-usage" type="text" name="{$name}" value="{$value}" placeholder="max usage">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="span8">
|
||||
<div class="well clearfix">
|
||||
<div class="span6">
|
||||
<div class="control-group">
|
||||
<label for="effect">Effect :</label>
|
||||
{form_field form=$form field='effect'}
|
||||
<select name="{$name}" value="{$value}" id="effect" class="span12">
|
||||
<option value="1" data-description="More description n°1 about item">Remove x percents for category Y</option>
|
||||
<option value="2" data-description="More description n°2 about item">Remove x percents</option>
|
||||
<option value="3" data-description="More description n°3 about item">Remove x amount</option>
|
||||
</select>
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
<span class="help-block">More description n°1 about item</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="span6">
|
||||
<div class="control-group">
|
||||
<label for="amount">Amount :</label>
|
||||
{form_field form=$form field='amount'}
|
||||
<input id="amount" type="text" name="{$name}" value="{$value}" placeholder="amount">
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="category">Category :</label>
|
||||
{*form_field form=$form field='category'*}
|
||||
<select name="{$name}" value="{$value}" id="category">
|
||||
<option value="1">Category 1</option>
|
||||
<option value="1">Category 2</option>
|
||||
<option value="1">Category 3</option>
|
||||
</select>
|
||||
{*if $error}{$message}{/if}*}
|
||||
{*/form_field*}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="short-description">Short description :</label>
|
||||
{form_field form=$form field='shortDescription'}
|
||||
<textarea id="short-description" name="{$name}" value="{$value}" placeholder="short description" class="span12" rows="5"></textarea>
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="description">Long description :</label>
|
||||
{form_field form=$form field='description'}
|
||||
<textarea id="description" name="{$name}" placeholder="long description" class="span12 wysiwyg" rows="10">{$value nofilter}</textarea>
|
||||
{if $error}{$message}{/if}
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="row-fluid">
|
||||
<div class="span12 general-block-decorator">
|
||||
<table class="table table-striped">
|
||||
<caption class="clearfix">
|
||||
Rules
|
||||
<a class="btn btn-primary pull-right" title="Add a new rule">
|
||||
<span class="icon-plus-sign icon-white"></span>
|
||||
</a>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Conditions</th>
|
||||
<th>Operator</th>
|
||||
<th>Value</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Total Amount</td>
|
||||
<td><span class="label">is superior or equals to</span></td>
|
||||
<td>300 €</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-primary btn-medium"><span class="icon-edit icon-white"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-danger btn-medium" data-toggle="confirm" data-target="#delete"><span class="icon-remove icon-white"></span> Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="label">AND</span> NbArticleFromCategory</td>
|
||||
<td><span class="label">is equals to</span></td>
|
||||
<td>12 - <a href="#" target="_blank">Chaussettes rouges</a></td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-primary btn-medium"><span class="icon-edit icon-white"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-danger btn-medium" data-toggle="confirm" data-target="#delete"><span class="icon-remove icon-white"></span> Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="label label-info">OR</span> Date</td>
|
||||
<td><span class="label">is inferior or equals to</span></td>
|
||||
<td>12/02/2014</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-primary btn-medium"><span class="icon-edit icon-white"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-danger btn-medium" data-toggle="confirm" data-target="#delete"><span class="icon-remove icon-white"></span> Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="row-fluid">
|
||||
<div class="span12 general-block-decorator">
|
||||
|
||||
<div class="control-group span2">
|
||||
<label for="type">Condition type :</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="type" id="type" value="1" checked> And
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="type" value="2"> Or
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group span4">
|
||||
<label for="category-rule">Rule's category :</label>
|
||||
<select name="categoryRule" id="category-rule">
|
||||
<option value="1" selected>Total amount</option>
|
||||
<option value="2">Date</option>
|
||||
<option value="3">NbArtFromCategory</option>
|
||||
</select>
|
||||
|
||||
<label for="category-rule">Rule's category :</label>
|
||||
<select name="categoryRule" id="category-rule">
|
||||
<option value="1">Total amount</option>
|
||||
<option value="2" selected>Date</option>
|
||||
<option value="3">NbArtFromCategory</option>
|
||||
</select>
|
||||
|
||||
<label for="category-rule">Rule's category :</label>
|
||||
<select name="categoryRule" id="category-rule">
|
||||
<option value="1">Total amount</option>
|
||||
<option value="2">Date</option>
|
||||
<option value="3" selected>NbArtFromCategory</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="control-group span6">
|
||||
<label for="operator">Operator :</label>
|
||||
<div class="controls">
|
||||
<select name="operator" id="operator">
|
||||
<option value="1">is superior to</option>
|
||||
<option value="2">equals to</option>
|
||||
<option value="3">is inferior to</option>
|
||||
<option value="4">is inferior or equals to</option>
|
||||
<option value="5">is superior or equals to</option>
|
||||
</select>
|
||||
<div class="input-append input-prepend">
|
||||
<span class="add-on">€</span>
|
||||
<input type="text" name="value" class="input-mini">
|
||||
<button class="add-on btn btn-primary"><span class="icon-plus icon-white"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="operator">Operator :</label>
|
||||
<div class="controls">
|
||||
<select name="operator" id="operator">
|
||||
<option value="1">is superior to</option>
|
||||
<option value="2">equals to</option>
|
||||
<option value="3">is inferior to</option>
|
||||
<option value="4">is inferior or equals to</option>
|
||||
<option value="5">is superior or equals to</option>
|
||||
</select>
|
||||
<div class="input-append input-prepend date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">
|
||||
<span class="add-on"><span class="icon-th"></span></span>
|
||||
<input type="text" name="value" class="input-mini">
|
||||
<button class="add-on btn btn-primary"><span class="icon-plus icon-white"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="operator">Operator :</label>
|
||||
<div class="controls">
|
||||
<select name="operator" id="operator">
|
||||
<option value="1">is superior to</option>
|
||||
<option value="2">equals to</option>
|
||||
<option value="3">is inferior to</option>
|
||||
<option value="4">is inferior or equals to</option>
|
||||
<option value="5">is superior or equals to</option>
|
||||
</select>
|
||||
<input type="text" name="value" class="input-mini">
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td id="minibrowser-breadcrumb"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="icon-th-list"></span> Categories list</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="minibrowser-categories"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
|
||||
@@ -1,311 +0,0 @@
|
||||
|
||||
|
||||
{$thelia_page_css_file = "assets/bootstrap-editable/css/bootstrap-editable.css"}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
|
||||
<section id="wrapper" class="container">
|
||||
|
||||
<nav>
|
||||
<ul class="breadcrumb">
|
||||
{include file="includes/coupon_breadcrumb.html"}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="page-header">
|
||||
<h1>Coupons : <small>Add a coupon</small></h1>
|
||||
</div>
|
||||
|
||||
<form action="#" method="post">
|
||||
|
||||
<section class="row-fluid">
|
||||
<div class="span12 general-block-decorator">
|
||||
|
||||
<div class="span4">
|
||||
<div class="control-group">
|
||||
<label for="code">Code :</label>
|
||||
<input id="code" type="text" name="code" placeholder="code">
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="title">Title :</label>
|
||||
<input id="title" type="text" name="title" placeholder="title">
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="enabled" class="checkbox">
|
||||
<input id="enabled" type="checkbox" name="isEnabled" value="1" checked>
|
||||
Is enabled ?
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="available-on-special-offers" class="checkbox">
|
||||
<input id="available-on-special-offers" type="checkbox" name="isAvailableOnSpecialOffers" value="1">
|
||||
Is available on special offers ?
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="cumulative" class="checkbox">
|
||||
<input id="cumulative" type="checkbox" name="isCumulative" value="1">
|
||||
Is cumulative ?
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="renoving-postage" class="checkbox">
|
||||
<input id="renoving-postage" type="checkbox" name="isRemovingPostage" value="1">
|
||||
Is renoving postage ?
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="expiration-date">Expiration date :</label>
|
||||
<div class="input-append date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">
|
||||
<input type="text" id="expiration-date" name="expirationDate" value="12/02/2012">
|
||||
<span class="add-on"><span class="icon-th"></span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="max-usage">Max usage :</label>
|
||||
<label for="is-unlimited" class="checkbox">
|
||||
<input id="is-unlimited" type="checkbox" name="isUnlimited" value="1" checked>
|
||||
Is unlimited ?
|
||||
</label>
|
||||
<input id="max-usage" type="text" name="maxUsage" placeholder="max usage">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="span8">
|
||||
<div class="well clearfix">
|
||||
<div class="span6">
|
||||
<div class="control-group">
|
||||
<label for="effect">Effect :</label>
|
||||
<select name="effect" id="effect" class="span12">
|
||||
<option value="1" data-description="More description n°1 about item">Remove x percents for category Y</option>
|
||||
<option value="2" data-description="More description n°2 about item">Remove x percents</option>
|
||||
<option value="3" data-description="More description n°3 about item">Remove x amount</option>
|
||||
</select>
|
||||
<span class="help-block">More description n°1 about item</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="span6">
|
||||
<div class="control-group">
|
||||
<label for="amount">Amount :</label>
|
||||
<input id="amount" type="text" name="amount" placeholder="amount">
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label for="category">Category :</label>
|
||||
<select name="category" id="category">
|
||||
<option value="1">Category 1</option>
|
||||
<option value="1">Category 2</option>
|
||||
<option value="1">Category 3</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="short-description">Short description :</label>
|
||||
<textarea id="short-description" name="shortDescription" placeholder="short description" class="span12" rows="5"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<div class="control-group">
|
||||
<label for="long-description">Long description :</label>
|
||||
<textarea id="long-description" name="longDescription" placeholder="long description" class="span12 wysiwyg" rows="10"></textarea>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="row-fluid">
|
||||
<div class="span12 general-block-decorator">
|
||||
<table class="table table-striped">
|
||||
<caption class="clearfix">
|
||||
Rules
|
||||
<a class="btn btn-primary pull-right" title="Add a new rule">
|
||||
<span class="icon-plus-sign icon-white"></span>
|
||||
</a>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Conditions</th>
|
||||
<th>Operator</th>
|
||||
<th>Value</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Total Amount</td>
|
||||
<td><span class="label">is superior or equals to</span></td>
|
||||
<td>300 €</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-primary btn-medium"><span class="icon-edit icon-white"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-danger btn-medium" data-toggle="confirm" data-target="#delete"><span class="icon-remove icon-white"></span> Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="label">AND</span> NbArticleFromCategory</td>
|
||||
<td><span class="label">is equals to</span></td>
|
||||
<td>12 - <a href="#" target="_blank">Chaussettes rouges</a></td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-primary btn-medium"><span class="icon-edit icon-white"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-danger btn-medium" data-toggle="confirm" data-target="#delete"><span class="icon-remove icon-white"></span> Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="label label-info">OR</span> Date</td>
|
||||
<td><span class="label">is inferior or equals to</span></td>
|
||||
<td>12/02/2014</td>
|
||||
<td>
|
||||
<a href="#url" class="btn btn-primary btn-medium"><span class="icon-edit icon-white"></span> Edit</a>
|
||||
<a href="#url" class="btn btn-danger btn-medium" data-toggle="confirm" data-target="#delete"><span class="icon-remove icon-white"></span> Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="row-fluid">
|
||||
<div class="span12 general-block-decorator">
|
||||
|
||||
<div class="control-group span2">
|
||||
<label for="type">Condition type :</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="type" id="type" value="1" checked> And
|
||||
</label>
|
||||
<label class="radio">
|
||||
<input type="radio" name="type" value="2"> Or
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="control-group span4">
|
||||
<label for="category-rule">Rule's category :</label>
|
||||
<select name="categoryRule" id="category-rule">
|
||||
<option value="1" selected>Total amount</option>
|
||||
<option value="2">Date</option>
|
||||
<option value="3">NbArtFromCategory</option>
|
||||
</select>
|
||||
|
||||
<label for="category-rule">Rule's category :</label>
|
||||
<select name="categoryRule" id="category-rule">
|
||||
<option value="1">Total amount</option>
|
||||
<option value="2" selected>Date</option>
|
||||
<option value="3">NbArtFromCategory</option>
|
||||
</select>
|
||||
|
||||
<label for="category-rule">Rule's category :</label>
|
||||
<select name="categoryRule" id="category-rule">
|
||||
<option value="1">Total amount</option>
|
||||
<option value="2">Date</option>
|
||||
<option value="3" selected>NbArtFromCategory</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="control-group span6">
|
||||
<label for="operator">Operator :</label>
|
||||
<div class="controls">
|
||||
<select name="operator" id="operator">
|
||||
<option value="1">is superior to</option>
|
||||
<option value="2">equals to</option>
|
||||
<option value="3">is inferior to</option>
|
||||
<option value="4">is inferior or equals to</option>
|
||||
<option value="5">is superior or equals to</option>
|
||||
</select>
|
||||
<div class="input-append input-prepend">
|
||||
<span class="add-on">€</span>
|
||||
<input type="text" name="value" class="input-mini">
|
||||
<button class="add-on btn btn-primary"><span class="icon-plus icon-white"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="operator">Operator :</label>
|
||||
<div class="controls">
|
||||
<select name="operator" id="operator">
|
||||
<option value="1">is superior to</option>
|
||||
<option value="2">equals to</option>
|
||||
<option value="3">is inferior to</option>
|
||||
<option value="4">is inferior or equals to</option>
|
||||
<option value="5">is superior or equals to</option>
|
||||
</select>
|
||||
<div class="input-append input-prepend date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">
|
||||
<span class="add-on"><span class="icon-th"></span></span>
|
||||
<input type="text" name="value" class="input-mini">
|
||||
<button class="add-on btn btn-primary"><span class="icon-plus icon-white"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label for="operator">Operator :</label>
|
||||
<div class="controls">
|
||||
<select name="operator" id="operator">
|
||||
<option value="1">is superior to</option>
|
||||
<option value="2">equals to</option>
|
||||
<option value="3">is inferior to</option>
|
||||
<option value="4">is inferior or equals to</option>
|
||||
<option value="5">is superior or equals to</option>
|
||||
</select>
|
||||
<input type="text" name="value" class="input-mini">
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td id="minibrowser-breadcrumb"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><span class="icon-th-list"></span> Categories list</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="minibrowser-categories"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</form>
|
||||
|
||||
</section> <!-- #wrapper -->
|
||||
|
||||
<aside id="delete" class="modal hide fade" role="dialog">
|
||||
<div class="modal-header">
|
||||
<h3>Confirmation</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Do you really want to delete this element?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-inverse" data-dismiss="modal">Cancel</button>
|
||||
<a href="#" class="btn btn-success" data-confirm="confirm">Confirm</a>
|
||||
</div>
|
||||
</aside> <!-- #delete / Delete confirmation -->
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
{javascripts file='../../assets/bootstrap-datepicker/js/bootstrap-datepicker.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../../assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(function($){
|
||||
miniBrowser(0, '/test_to_remove/datas_coupon_edit.json');
|
||||
});
|
||||
</script>
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
@@ -1,5 +0,0 @@
|
||||
{check_auth context="admin" roles="ADMIN" permissions="admin.coupon.edit" login_tpl="/admin/login"}
|
||||
|
||||
{$page_title={intl l='Coupon edition'}}
|
||||
|
||||
{include file='coupon/includes/edit.html'}
|
||||
401
templates/admin/default/currencies.html
Normal file
401
templates/admin/default/currencies.html
Normal file
@@ -0,0 +1,401 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Currencies'}{/block}
|
||||
|
||||
{block name="check-permissions"}admin.configuration.currencies.view{/block}
|
||||
|
||||
{block name="after-admin-css"}
|
||||
{stylesheets file='assets/bootstrap-editable/css/bootstrap-editable.css' filters='cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="currencies">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a> <span class="divider">/</span></li>
|
||||
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a> <span class="divider">/</span></li>
|
||||
<li><a href="{url path='/admin/configuration/currencies'}">{intl l="Currencies"}</a></li>
|
||||
</ul>
|
||||
|
||||
{module_include location='currencies_top'}
|
||||
|
||||
<div class="row-fluid">
|
||||
|
||||
<div class="span12">
|
||||
<form action="{url path='/admin/configuration/currencies/change-values'}" method="post">
|
||||
<div class="general-block-decorator">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<caption>
|
||||
{intl l='Currencies'}
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.currencies.create"}
|
||||
<a class="btn btn-primary action-btn" title="{intl l='Add a new currency'}" href="#add_currency_dialog" data-toggle="modal">
|
||||
<i class="icon-plus-sign icon-white"></i>
|
||||
</a>
|
||||
{/loop}
|
||||
|
||||
</caption>
|
||||
<tr>
|
||||
<th>
|
||||
{if $order == 'id'}
|
||||
<i class="icon icon-chevron-up"></i>
|
||||
{$order_change = 'id_reverse'}
|
||||
{elseif $order == 'id_reverse'}
|
||||
<i class="icon icon-chevron-down"></i>
|
||||
{$order_change = 'id'}
|
||||
{else}
|
||||
{$order_change = 'id'}
|
||||
{/if}
|
||||
<a href="{url path='/admin/configuration/currencies' order=$order_change}">
|
||||
{intl l="ID"}
|
||||
</a>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{if $order == 'alpha'}
|
||||
<i class="icon icon-chevron-up"></i>
|
||||
{$order_change = 'alpha_reverse'}
|
||||
{elseif $order == 'alpha_reverse'}
|
||||
<i class="icon icon-chevron-down"></i>
|
||||
{$order_change = 'alpha'}
|
||||
{else}
|
||||
{$order_change = 'alpha'}
|
||||
{/if}
|
||||
<a href="{url path='/admin/configuration/currencies' order=$order_change}">
|
||||
{intl l="Name"}
|
||||
</a>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{if $order == 'code'}
|
||||
<i class="icon icon-chevron-up"></i>
|
||||
{$order_change = 'code_reverse'}
|
||||
{elseif $order == 'code_reverse'}
|
||||
<i class="icon icon-chevron-down"></i>
|
||||
{$order_change = 'code'}
|
||||
{else}
|
||||
{$order_change = 'code'}
|
||||
{/if}
|
||||
<a href="{url path='/admin/configuration/currencies' order=$order_change}">{intl l="ISO 4217 Code"}</a>
|
||||
<a title="{intl l='More information about ISO 4217'}" href="http://fr.wikipedia.org/wiki/ISO_4217" target="_blank"><i class="icon icon-question-sign"></i></a>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{if $order == 'symbol'}
|
||||
<i class="icon icon-chevron-up"></i>
|
||||
{$order_change = 'symbol_reverse'}
|
||||
{elseif $order == 'symbol_reverse'}
|
||||
<i class="icon icon-chevron-down"></i>
|
||||
{$order_change = 'symbol'}
|
||||
{else}
|
||||
{$order_change = 'symbol'}
|
||||
{/if}
|
||||
<a href="{url path='/admin/configuration/currencies' order=$order_change}">
|
||||
{intl l="Symbol"}
|
||||
</a>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{if $order == 'rate'}
|
||||
<i class="icon icon-chevron-up"></i>
|
||||
{$order_change = 'rate_reverse'}
|
||||
{elseif $order == 'rate_reverse'}
|
||||
<i class="icon icon-chevron-down"></i>
|
||||
{$order_change = 'rate'}
|
||||
{else}
|
||||
{$order_change = 'rate'}
|
||||
{/if}
|
||||
<a href="{url path='/admin/configuration/currencies' order=$order_change}">
|
||||
{intl l="Rate in €"}
|
||||
</a>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
{if $order == 'manual'}
|
||||
<i class="icon icon-chevron-up"></i>
|
||||
{$order_change = 'manual_reverse'}
|
||||
{elseif $order == 'manual_reverse'}
|
||||
<i class="icon icon-chevron-down"></i>
|
||||
{$order_change = 'manual'}
|
||||
{else}
|
||||
{$order_change = 'manual'}
|
||||
{/if}
|
||||
|
||||
<a href="{url path='/admin/configuration/currencies' order="$order_change"}">{intl l="Position"}</a>
|
||||
</th>
|
||||
|
||||
<th>{intl l="Default"}</th>
|
||||
|
||||
{module_include location='currencies_table_header'}
|
||||
|
||||
<th> </th>
|
||||
</tr>
|
||||
|
||||
{loop name="currencies" type="currency" backend_context="1" lang=$lang_id order=$order}
|
||||
<tr>
|
||||
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.currencies.change"}
|
||||
<a title="{intl l='Change this currency'}" href="{url path='/admin/configuration/currencies/change' currency_id="$ID"}">{$NAME}</a>
|
||||
{/loop}
|
||||
{elseloop rel="can_change"}
|
||||
{$NAME}
|
||||
{/elseloop}
|
||||
</td>
|
||||
|
||||
<td>{$ISOCODE}</td>
|
||||
|
||||
<td>{$SYMBOL}</td>
|
||||
|
||||
<td>{$RATE|string_format:"%.4f"}</td>
|
||||
|
||||
<td>
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.category.edit"}
|
||||
<a href="{url path='/admin/configuration/currencies/positionUp' currency_id=$ID}"><i class="icon-arrow-up"></i></a>
|
||||
<span class="currencyPositionChange" data-id="{$ID}">{$POSITION}</span>
|
||||
<a href="{url path='/admin/configuration/currencies/positionDown' currency_id=$ID}"><i class="icon-arrow-down"></i></a>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="can_change"}
|
||||
{$POSITION}
|
||||
{/elseloop}
|
||||
</td>
|
||||
|
||||
<td><input type="radio" name="default[{$ID}]" value="1" {if $IS_DEFAULT}checked="checked"{/if}/></td>
|
||||
|
||||
{module_include location='currencies_table_row'}
|
||||
|
||||
<td class="actions">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.currencies.change"}
|
||||
<a class="btn btn-mini currency-change" title="{intl l='Change this currency'}" href="{url path='/admin/configuration/currencies/change' currency_id="$ID"}"><i class="icon-edit"></i></a>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.currencies.delete"}
|
||||
<a class="btn btn-mini currency-delete" title="{intl l='Delete this currency'}" href="#delete_currency_dialog" data-id="{$ID}" data-toggle="modal"><i class="icon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="currencies"}
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<div class="alert alert-info">
|
||||
{intl l="No currency has been created yet. Click the + button to create one."}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='currencies_bottom'}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{* Adding a new currency *}
|
||||
|
||||
<div class="modal hide fade" id="add_currency_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Create a new currency"}</h3>
|
||||
</div>
|
||||
|
||||
{form name="thelia.admin.currency.creation"}
|
||||
<form method="POST" action="{url path='/admin/configuration/currencies/create'}" {form_enctype form=$form}>
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created currency ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/currencies/change' currency_id='_ID_'}" />
|
||||
{/form_field}
|
||||
|
||||
{* We do not allow users to create secured currencies from here *}
|
||||
|
||||
<div class="modal-body">
|
||||
|
||||
{if #form_error}<div class="alert alert-block alert-error" id="add_currency_dialog_error">#form_error_currency</div>{/if}
|
||||
|
||||
<div class="control-group">
|
||||
|
||||
<label class="control-label">
|
||||
{intl l='Name *'}
|
||||
</label>
|
||||
|
||||
<div class="controls">
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$LOCALE}" />
|
||||
{/form_field}
|
||||
|
||||
<div class="input-append">
|
||||
{form_field form=$form field='name'}
|
||||
<span {if $error}class="error"{/if}>
|
||||
<input type="text" required="required" name="{$name}" value="{$value}" title="{intl l='Currency name'}" placeholder="{intl l='Name'}">
|
||||
</span>
|
||||
{/form_field}
|
||||
<span class="add-on"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" /></span>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l="Enter here the currency name in the default language ($TITLE)"}</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">
|
||||
{intl l='ISO 4217 code *'}
|
||||
</label>
|
||||
|
||||
<div class="controls">
|
||||
{form_field form=$form field='symbol'}
|
||||
<span {if $error}class="error"{/if}>
|
||||
<input type="text" required="required" name="{$name}" value="{$value}" title="{intl l='ISO 4217 code'}" placeholder="{intl l='Code'}">
|
||||
</span>
|
||||
|
||||
<div class="help-block">
|
||||
<a href="http://fr.wikipedia.org/wiki/ISO_4217" target="_blank">{intl l='More information about ISO 4217'}</a>
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">
|
||||
{intl l='Symbol *'}
|
||||
</label>
|
||||
|
||||
<div class="controls">
|
||||
{form_field form=$form field='symbol'}
|
||||
<span {if $error}class="error"{/if}>
|
||||
<input type="text" required="required" name="{$name}" value="{$value}" title="{intl l='Currency symbol'}" placeholder="{intl l='Symbol'}">
|
||||
</span>
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">
|
||||
{intl l='Rate *'}
|
||||
</label>
|
||||
|
||||
<div class="controls">
|
||||
{form_field form=$form field='symbol'}
|
||||
<span {if $error}class="error"{/if}>
|
||||
<input type="text" required="required" name="{$name}" value="{$value}" title="{intl l='Currency rate'}" placeholder="{intl l='Rate'}">
|
||||
</span>
|
||||
<div class="help-block">{intl l="Currency rate, in Euro"}</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary">{intl l="Create this currency"}</button>
|
||||
<button type="button" class="btn" data-dismiss="modal" aria-hidden="true">{intl l="Cancel"}</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
|
||||
<div class="modal hide fade" id="delete_currency_dialog" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{intl l="Delete a currency"}</h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<p>{intl l="Do you really want to delete this currency ?"}</p>
|
||||
</div>
|
||||
|
||||
<form method="post" action="{url path='/admin/configuration/currencies/delete'}">
|
||||
<input type="hidden" name="currency_id" id="currency_delete_id" value="" />
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary">{intl l="Yes"}</button>
|
||||
<button type="button" class="btn" data-dismiss="modal" aria-hidden="true">{intl l="No"}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name="after-javascript-include"}
|
||||
{javascripts file='assets/bootstrap-editable/js/bootstrap-editable.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
// Set proper currency ID in delete from
|
||||
$('a.currency-delete').click(function(ev) {
|
||||
$('#currency_delete_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
{* display the form creation dialog if it contains errors *}
|
||||
|
||||
{form name="thelia.admin.currency.creation"}
|
||||
{if #form_error}
|
||||
$('#add_currency_dialog').modal();
|
||||
{/if}
|
||||
{/form}
|
||||
|
||||
{* Always reset create dialog on close *}
|
||||
|
||||
$('#add_currency_dialog').on('hidden',function() {
|
||||
// Hide error currency
|
||||
$('#add_currency_dialog_error').remove();
|
||||
|
||||
// Clear error status
|
||||
$("#add_currency_dialog .error").removeClass('error');
|
||||
|
||||
// Empty field values
|
||||
$("#add_currency_dialog input[type=text]").val('');
|
||||
});
|
||||
|
||||
{* Inline editing of object position using bootstrap-editable *}
|
||||
|
||||
$('.currencyPositionChange').editable({
|
||||
type : 'text',
|
||||
title : '{intl l="Enter new currency position"}',
|
||||
mode : 'popup',
|
||||
inputclass : 'input-mini',
|
||||
placement : 'left',
|
||||
success : function(response, newValue) {
|
||||
// The URL template
|
||||
var url = "{url path='/admin/configuration/currencies/changePosition' currency_id='__ID__' position='__POS__'}";
|
||||
|
||||
// Perform subtitutions
|
||||
url = url.replace('__ID__', $(this).data('id'))
|
||||
.replace('__POS__', newValue);
|
||||
|
||||
// Reload the page
|
||||
location.href = url;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
@@ -1,9 +1,10 @@
|
||||
{check_auth roles="ADMIN" permissions="admin.catalog.view" login_tpl="/admin/login"}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{$page_title={intl l='Edit category'}}
|
||||
{block name="check-permissions"}admin.catalog.view{/block}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{block name="page-title"}{intl l='Edit category'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="catalog edit-category">
|
||||
<div id="wrapper" class="container">
|
||||
<ul class="breadcrumb">
|
||||
@@ -210,9 +211,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
<script>
|
||||
|
||||
$(function() {
|
||||
@@ -229,5 +230,4 @@ $(function() {
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{/block}
|
||||
@@ -1,10 +1,22 @@
|
||||
{$page_title={intl l='An error occured'}}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{* -- We do not check admin login on this page *}
|
||||
{block name="check-auth"}{/block}
|
||||
|
||||
{block name="page-title"}{intl l='An error occured'}{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div id="wrapper" class="container">
|
||||
<h1>{intl l="Oops! An Error Occurred"}</h1>
|
||||
<p>{$error_message}</p>
|
||||
</div>
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<h1>{intl l="Oops! An Error Occurred"}</h1>
|
||||
|
||||
{block name="error-message"}<div class="alert alert-error">{$error_message}</div>{/block}
|
||||
|
||||
<p><i class="icon icon-backward"></i> <a href="{url path='/admin/home'}">{intl l="Go to administration home"}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/block}
|
||||
@@ -1,18 +1,18 @@
|
||||
{check_auth roles="ADMIN" login_tpl="/admin/login"}
|
||||
{$page_title={intl l='Home'}}
|
||||
{include file='includes/header.inc.html'}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
<div class="homepage">
|
||||
<div id="wrapper" class="container">
|
||||
{block name="page-title"}{intl l='Back-office home'}{/block}
|
||||
|
||||
{module_include location='home_top'}
|
||||
{block name="main-content"}
|
||||
<div class="homepage">
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<div class="span12">
|
||||
This is the administration home page. Put some interesting statistics here, and display useful information :)
|
||||
{module_include location='home_top'}
|
||||
|
||||
<div class="span12">
|
||||
This is the administration home page. Put some interesting statistics here, and display useful information :)
|
||||
</div>
|
||||
|
||||
{module_include location='home_bottom'}
|
||||
</div>
|
||||
|
||||
{module_include location='home_bottom'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{/block}
|
||||
32
templates/admin/default/includes/confirmation-modal.html
Normal file
32
templates/admin/default/includes/confirmation-modal.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{*
|
||||
Params
|
||||
- id : aside element id (default delete)
|
||||
- title : modal title (default Confirmation)
|
||||
- message : modal message (default Do you really want to delete this element ?)
|
||||
*}
|
||||
{block name="confirmation-modal"}
|
||||
<aside id="{if $id}$id{else}delete{/if}" class="modal hide fade" role="dialog">
|
||||
<div class="modal-header">
|
||||
<h3>
|
||||
{if $title}
|
||||
$title
|
||||
{else}
|
||||
{intl l='Confirmation'}
|
||||
{/if}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
{if $message}
|
||||
$message
|
||||
{else}
|
||||
{intl l='Do you really want to delete this element ?'}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-inverse" data-dismiss="modal">{intl l='Cancel'}</button>
|
||||
<a href="#" class="btn btn-success" data-confirm="confirm">{intl l='Confirm'}</a>
|
||||
</div>
|
||||
</aside> <!-- #delete / Delete confirmation -->
|
||||
{/block}
|
||||
@@ -1,20 +0,0 @@
|
||||
{module_include location='before_footer'}
|
||||
|
||||
<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>
|
||||
|
||||
{module_include location='after_footer'}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,167 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{$lang_code}">
|
||||
<head>
|
||||
<title>{intl l='Thelia Back Office'}{if ! empty($page_title)} - {$page_title}{/if}</title>
|
||||
|
||||
{images file='../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='../assets/bootstrap/css/bootstrap.css' filters='cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{stylesheets file='../assets/bootstrap/css/bootstrap-responsive.css' filters='cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{* Include here page specifc CSS file, if any *}
|
||||
|
||||
{if ! empty($thelia_page_css_file)}
|
||||
{stylesheets file="../$thelia_page_css_file" filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}" target="screen">
|
||||
{/stylesheets}
|
||||
{/if}
|
||||
|
||||
{stylesheets file='../assets/css/*' filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{* Include here page specifc CSS file, if any *}
|
||||
|
||||
{if ! empty($thelia_page_css_file)}
|
||||
{stylesheets file="../$thelia_page_css_file" filters='less,cssembed'}
|
||||
<link rel="stylesheet" href="{$asset_url}" target="screen">
|
||||
{/stylesheets}
|
||||
{/if}
|
||||
|
||||
{* Modules css are included here *}
|
||||
|
||||
{module_include location='head_css'}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{* display top bar once admin is connected *}
|
||||
|
||||
{loop name="top-bar-auth" type="auth" roles="ADMIN"}
|
||||
|
||||
{module_include location='before_topbar'}
|
||||
|
||||
<div class="topbar">
|
||||
<div class="container">
|
||||
|
||||
<div class="version-info">{intl l='Version %ver' ver="{$THELIA_VERSION}"}</div>
|
||||
|
||||
{module_include location='inside_topbar'}
|
||||
|
||||
<div class="user-info">
|
||||
<a class="profile" href="{url path='admin/edit_profile'}">{admin attr="firstname"} {admin attr="lastname"}</a>
|
||||
<a class="logout" href="{url path='admin/logout'}" title="{intl l='Close administation session'}">{intl l="Logout"}</a></div>
|
||||
|
||||
{loop name="top-bar-search" type="auth" roles="ADMIN" permissions="admin.search"}
|
||||
<form class="form-search pull-right" action="{url path='/admin/search'}">
|
||||
<div class="control-group">
|
||||
<div class="input-append">
|
||||
<input type="text" class="input-medium search-query" id="search_term" name="search_term" placeholder="{intl l='Search'}" />
|
||||
<button class="btn"><i class="icon-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/loop}
|
||||
|
||||
<div class="view-shop"><a href="{navigate to="index"}" title="{intl l='View site'}" target="_blank"><i class="icon-white icon-eye-open"></i> {intl l="View shop"}</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='after_topbar'}
|
||||
|
||||
|
||||
{module_include location='before_top_menu'}
|
||||
|
||||
<div class="navbar">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<div class="nav-collapse">
|
||||
|
||||
<ul class="nav">
|
||||
|
||||
<li class="{if $admin_current_location == 'home'}active{/if}" id="home_menu">
|
||||
<a href="{url path='/admin/home'}">{intl l="Home"}</a>
|
||||
</li>
|
||||
|
||||
{loop name="menu-auth-customer" type="auth" roles="ADMIN" permissions="admin.customers.view"}
|
||||
<li class="{if $admin_current_location == 'customer'}active{/if}" id="customers_menu">
|
||||
<a href="{url path='/admin/customers'}">{intl l="Customers"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-order" type="auth" roles="ADMIN" permissions="admin.orders.view"}
|
||||
<li class="dropdown {if $admin_current_location == 'customer'}active{/if}" id="orders_menu" data-toggle="dropdown">
|
||||
|
||||
<a href="#">{intl l="Orders"} <span class="caret"></span></a>
|
||||
|
||||
<ul class="dropdown-menu config_menu" role="menu">
|
||||
|
||||
<li role="menuitem"><a data-target="{url path='admin/orders'}" href="{url path='admin/orders'}">
|
||||
{intl l="All orders"}
|
||||
<span class="badge badge-important">{count type="order"}</span></a>
|
||||
</li>
|
||||
|
||||
{loop name="order-status-list" type="order-status"}
|
||||
<li role="menuitem">
|
||||
<a data-target="{url path='admin/orders/$LABEL'}" href="{url path='admin/orders/$LABEL'}">
|
||||
{$LABEL} <span class="badge badge-important">{count type="order" status="{$ID}"}</span>
|
||||
</a>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-catalog" type="auth" roles="ADMIN" permissions="admin.catalog.view"}
|
||||
<li class="{if $admin_current_location == 'catalog'}active{/if}" id="catalog_menu">
|
||||
<a href="{url path='/admin/catalog'}">{intl l="Catalog"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-content" type="auth" roles="ADMIN" permissions="admin.content.view"}
|
||||
<li class="{if $admin_current_location == 'content'}active{/if}" id="content_menu">
|
||||
<a href="{url path='/admin/content'}">{intl l="Content"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-discount" type="auth" roles="ADMIN" permissions="admin.discount.view"}
|
||||
<li class="{if $admin_current_location == 'discount'}active{/if}" id="discount_menu">
|
||||
<a href="{url path='/admin/discount'}">{intl l="Discount"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-config" type="auth" roles="ADMIN" permissions="admin.config.view"}
|
||||
<li class="{if $admin_current_location == 'configuration'}active{/if}" id="config_menu">
|
||||
<a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
{loop name="menu-auth-modules" type="auth" roles="ADMIN" permissions="admin.modules.view"}
|
||||
<li class="{if $admin_current_location == 'modules'}active{/if}" id="modules_menu">
|
||||
<a href="{url path='/admin/modules'}">{intl l="Modules"}</a>
|
||||
</li>
|
||||
|
||||
{module_include location='in_top_menu_items'}
|
||||
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='after_top_menu'}
|
||||
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="top-bar-auth"}
|
||||
<div class="brandbar brandbar-wide container">
|
||||
<a class="brand" href="{url path='/admin'}">{images file='../assets/img/logo-thelia-34px.png'}<img src="{$asset_url}" alt="{intl l='Thelia, solution e-commerce libre'}" />{/images}</a>
|
||||
</div>
|
||||
{/elseloop}
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
{* Include required JS files *}
|
||||
|
||||
{javascripts file='../assets/js/jquery.min.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='../assets/bootstrap/js/bootstrap.min.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{* Modules scripts are included now *}
|
||||
{module_include location='footer_js'}
|
||||
11
templates/admin/default/includes/notifications.html
Normal file
11
templates/admin/default/includes/notifications.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{*
|
||||
Params
|
||||
- type : notification type (default alert)
|
||||
- message : modal message
|
||||
*}
|
||||
{if $message}
|
||||
<div class="{if $type}$type{else}alert alert-info{/if}">
|
||||
<span class="icon-question-sign"></span>
|
||||
{$message}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1,66 +1,70 @@
|
||||
{$page_title={intl l='Welcome'}}
|
||||
{include file='includes/header.inc.html'}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
<div class="loginpage">
|
||||
{* -- We do not check admin login on this page *}
|
||||
{block name="check-auth"}{/block}
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
{block name="page-title"}{intl l='Welcome'}{/block}
|
||||
|
||||
{module_include location='index_top'}
|
||||
{block name="main-content"}
|
||||
<div class="loginpage">
|
||||
|
||||
<div class="hero-unit">
|
||||
<h1>{intl l='Thelia Back Office'}</h1>
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
{form name="thelia.admin.login"}
|
||||
<form action="{url path='/admin/checklogin'}" method="post" class="well form-inline" {form_enctype form=$form}>
|
||||
{module_include location='index_top'}
|
||||
|
||||
{if #form_error}<div class="alert alert-error">#form_error_message</div>{/if}
|
||||
<div class="hero-unit">
|
||||
<h1>{intl l='Thelia Back Office'}</h1>
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
{form name="thelia.admin.login"}
|
||||
<form action="{url path='/admin/checklogin'}" method="post" class="well form-inline" {form_enctype form=$form}>
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin'}" /> {* on success, redirect to /admin *}
|
||||
{/form_field}
|
||||
{if #form_error}<div class="alert alert-error">#form_error_message</div>{/if}
|
||||
|
||||
{form_field form=$form field='username'}
|
||||
<span {if $error}class="error"{/if}>
|
||||
<input type="text" class="input" placeholder="{intl l='User name'}" name="{$name}" value="{$value}" {$attr} />
|
||||
</span>
|
||||
{/form_field}
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='password'}
|
||||
<span {if $error}class="error"{/if}>
|
||||
<input type="password" class="input" placeholder="{intl l='Password'}" name="{$name}" {$attr} />
|
||||
</span>
|
||||
{/form_field}
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin'}" /> {* on success, redirect to /admin *}
|
||||
{/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}
|
||||
{form_field form=$form field='username'}
|
||||
<span {if $error}class="error"{/if}>
|
||||
<input type="text" class="input" placeholder="{intl l='User name'}" name="{$name}" value="{$value}" {$attr} />
|
||||
</span>
|
||||
{/form_field}
|
||||
|
||||
<span class="pull-right"><button type="submit" class="btn btn-primary">{intl l='Login'} <i class="icon-play icon-white"></i></button></span>
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
{form_field form=$form field='password'}
|
||||
<span {if $error}class="error"{/if}>
|
||||
<input type="password" class="input" placeholder="{intl l='Password'}" name="{$name}" {$attr} />
|
||||
</span>
|
||||
{/form_field}
|
||||
|
||||
{module_include location='index_middle'}
|
||||
{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}
|
||||
|
||||
<div class="row-fluid feed-list">
|
||||
<div class="span4 offset4">
|
||||
<div class="well">{intl l="Loading Thelia lastest news..."}</div>
|
||||
<span class="pull-right"><button type="submit" class="btn btn-primary">{intl l='Login'} <i class="icon-play icon-white"></i></button></span>
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
|
||||
{module_include location='index_middle'}
|
||||
|
||||
<div class="row-fluid feed-list">
|
||||
<div class="span6 offset3">
|
||||
<div class="alert alert-info">{intl l="Loading Thelia lastest news..."}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='index_bottom'}
|
||||
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{module_include location='index_bottom'}
|
||||
|
||||
</div>
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$(".feed-list").load("{admin_viewurl view='includes/thelia_news_feed'}");
|
||||
})
|
||||
</script>
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{block name="javascript-initialization"}
|
||||
<script>
|
||||
$(function () {
|
||||
$(".feed-list").load("{admin_viewurl view='includes/thelia_news_feed'}");
|
||||
})
|
||||
</script>
|
||||
{/block}
|
||||
@@ -1,9 +1,10 @@
|
||||
{check_auth roles="ADMIN" permissions="admin.configuration.messages.edit" login_tpl="/admin/login"}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{$page_title={intl l='Edit a mailing template'}}
|
||||
{block name="page-title"}{intl l='Edit a mailing template'}{/block}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{block name="check-permissions"}admin.configuration.messages.edit{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="messages edit-message">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
@@ -27,11 +28,9 @@
|
||||
|
||||
<div class="form-container">
|
||||
<div class="form-horizontal span12">
|
||||
<fieldset>
|
||||
|
||||
{form name="thelia.admin.message.modification"}
|
||||
<form method="POST" action="{url path='/admin/configuration/messages/save-change'}" {form_enctype form=$form}>
|
||||
|
||||
{form name="thelia.admin.message.modification"}
|
||||
<form method="POST" action="{url path='/admin/configuration/messages/save-change'}" {form_enctype form=$form}>
|
||||
<fieldset>
|
||||
{* Be sure to get the message ID, even if the form could not be validated *}
|
||||
<input type="hidden" name="message_id" value="{$message_id}" />
|
||||
|
||||
@@ -142,9 +141,15 @@
|
||||
</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
</form>
|
||||
{/form}
|
||||
</fieldset>
|
||||
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<p>{intl l='Message created on %date_create. Last modification: %date_change' df=$datetime_format date_create=$CREATE_DATE->format($datetime_format) date_change=$UPDATE_DATE->format($datetime_format)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -165,7 +170,4 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{/block}
|
||||
@@ -1,9 +1,10 @@
|
||||
{check_auth roles="ADMIN" permissions="admin.configuration.messages.view" login_tpl="/admin/login"}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{$page_title={intl l='Thelia Mailing Templates'}}
|
||||
{block name="page-title"}{intl l='Thelia Mailing Templates'}{/block}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{block name="check-permissions"}admin.configuration.messages.view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="messages">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
@@ -202,9 +203,9 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@@ -235,5 +236,4 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{/block}
|
||||
@@ -1,9 +1,10 @@
|
||||
{check_auth roles="ADMIN" permissions="admin.configuration.variables.edit" login_tpl="/admin/login"}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{$page_title={intl l='Edit a system variable'}}
|
||||
{block name="page-title"}{intl l='Edit a system variable'}{/block}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{block name="check-permissions"}admin.configuration.variables.edit{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="variables edit-variable">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
@@ -27,11 +28,9 @@
|
||||
|
||||
<div class="form-container">
|
||||
<div class="form-horizontal span12">
|
||||
<fieldset>
|
||||
|
||||
{form name="thelia.admin.config.modification"}
|
||||
<form method="POST" action="{url path='/admin/configuration/variables/save-change'}" {form_enctype form=$form}>
|
||||
|
||||
{form name="thelia.admin.config.modification"}
|
||||
<form method="POST" action="{url path='/admin/configuration/variables/save-change'}" {form_enctype form=$form}>
|
||||
<fieldset>
|
||||
{* Be sure to get the variable ID, even if the form could not be validated *}
|
||||
<input type="hidden" name="variable_id" value="{$variable_id}" />
|
||||
|
||||
@@ -107,15 +106,22 @@
|
||||
|
||||
{include file="includes/standard-description-form-fields.html"}
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
</fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<p>{intl l='Variable created on %date_create. Last modification: %date_change' df=$datetime_format date_create=$CREATE_DATE->format($datetime_format) date_change=$UPDATE_DATE->format($datetime_format)}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="config_edit"}
|
||||
@@ -130,7 +136,4 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{/block}
|
||||
@@ -1,9 +1,10 @@
|
||||
{check_auth roles="ADMIN" permissions="admin.configuration.variables.view" login_tpl="/admin/login"}
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{$page_title={intl l='Thelia System Variables'}}
|
||||
{block name="page-title"}{intl l='Thelia System Variables'}{/block}
|
||||
|
||||
{include file='includes/header.inc.html'}
|
||||
{block name="check-permissions"}admin.configuration.variables.view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="variables">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
@@ -223,9 +224,9 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{include file='includes/js.inc.html'}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@@ -280,5 +281,4 @@
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
{include file='includes/footer.inc.html'}
|
||||
{/block}
|
||||
Reference in New Issue
Block a user