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

This commit is contained in:
Manuel Raynaud
2013-09-03 11:28:13 +02:00
34 changed files with 1804 additions and 428 deletions

View 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),
);
}
}

View File

@@ -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>

View File

@@ -53,6 +53,9 @@
<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"/>
</forms>

View File

@@ -83,6 +83,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}">

View File

@@ -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())
));

View 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'));
}
}

View 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;
}
}

View 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;
}
}

View 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;
}
}

View 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;
}
}

View File

@@ -194,7 +194,6 @@ final class TheliaEvents
const BEFORE_DELETECONFIG = "action.before_deleteConfig";
const AFTER_DELETECONFIG = "action.after_deleteConfig";
// -- Messages management ---------------------------------------------
const MESSAGE_CREATE = "action.createMessage";
@@ -210,4 +209,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";
}

View File

@@ -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())
;

View File

@@ -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);
}

View File

@@ -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;
}
}

View 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));
}
}
}

View 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";
}
}

View File

@@ -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));
}
}

View File

@@ -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}

View 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='&copy; 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>

View File

@@ -584,6 +584,10 @@ form .info .input-append .add-on {
.actions {
text-align: right;
}
.form {
margin-bottom: 0;
}
}
// Reduce bottom margin of admin tabs.

View File

@@ -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}

View File

@@ -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}

View 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 &euro;"}
</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>&nbsp;</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">&times;</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">&times;</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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -1,20 +0,0 @@
{module_include location='before_footer'}
<hr />
<footer class="footer">
<div class="container">
<p>{intl l='&copy; 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>

View File

@@ -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}

View File

@@ -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'}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}

View File

@@ -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}