Merge branch 'admin'

Conflicts:
	core/lib/Thelia/Admin/Controller/BaseAdminController.php
	core/lib/Thelia/Config/Resources/config.xml
	core/lib/Thelia/Core/Template/Element/BaseLoop.php
	core/lib/Thelia/Core/Template/Loop/Category.php
	core/lib/Thelia/Core/Template/Smarty/Plugins/TheliaLoop.php
	core/lib/Thelia/Model/Admin.php
	core/lib/Thelia/Model/Customer.php
This commit is contained in:
franck
2013-07-08 11:27:37 +02:00
62 changed files with 752 additions and 282 deletions

View File

@@ -2,8 +2,40 @@
namespace Thelia\Model;
use Thelia\Core\Security\User\UserInterface;
use Thelia\Model\Base\Admin as BaseAdmin;
class Admin extends BaseAdmin {
/**
* Skeleton subclass for representing a row from the 'admin' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.Thelia.Model
*/
class Admin extends BaseAdmin implements UserInterface
{
/**
* {@inheritDoc}
*/
public function getUsername() {
return $this->getLogin();
}
/**
* {@inheritDoc}
*/
public function eraseCredentials() {
$this->setPassword(null);
}
/**
* {@inheritDoc}
*/
public function getRoles() {
return array(new Role('USER_ADMIN'));
}
}

View File

@@ -6,11 +6,26 @@ use Thelia\Model\Base\Customer as BaseCustomer;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Thelia\Core\Event\CustomRefEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Security\User\UserInterface;
use Propel\Runtime\Connection\ConnectionInterface;
class Customer extends BaseCustomer {
/**
* Skeleton subclass for representing a row from the 'customer' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package propel.generator.Thelia.Model
*/
class Customer extends BaseCustomer implements UserInterface
{
/**
* @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
*/
@@ -97,4 +112,26 @@ class Customer extends BaseCustomer {
{
$this->dispatcher = $dispatcher;
}
/**
* {@inheritDoc}
*/
public function getUsername() {
return $this->getEmail();
}
/**
* {@inheritDoc}
*/
public function eraseCredentials() {
$this->setPassword(null);
}
/**
* {@inheritDoc}
*/
public function getRoles() {
return array(new Role('USER_CUSTOMER'));
}
}

View File

@@ -151,7 +151,7 @@ class AttributeAvI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'attribute_av', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -106,7 +106,7 @@ class AttributeAvTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class AttributeI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'attribute', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class AttributeTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class CategoryI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'category', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -131,7 +131,7 @@ class CategoryTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ConfigI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'config', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -116,7 +116,7 @@ class ConfigTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ContentI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'content', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -121,7 +121,7 @@ class ContentTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class CountryI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'country', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -116,7 +116,7 @@ class CountryTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -141,7 +141,7 @@ class CustomerTitleI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'customer_title', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('SHORT', 'Short', 'VARCHAR', false, 10, null);
$this->addColumn('LONG', 'Long', 'VARCHAR', false, 45, null);
} // initialize()

View File

@@ -106,7 +106,7 @@ class CustomerTitleTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class DocumentI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'document', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -126,7 +126,7 @@ class DocumentTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class FeatureAvI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'feature_av', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class FeatureAvTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class FeatureI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'feature', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -106,7 +106,7 @@ class FeatureTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class FolderI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'folder', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -131,7 +131,7 @@ class FolderTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class GroupI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'group', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class GroupTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ImageI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'image', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -126,7 +126,7 @@ class ImageTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -146,7 +146,7 @@ class MessageI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'message', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'LONGVARCHAR', false, null, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('DESCRIPTION_HTML', 'DescriptionHtml', 'CLOB', false, null, null);

View File

@@ -126,7 +126,7 @@ class MessageTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ModuleI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'module', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -116,7 +116,7 @@ class ModuleTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class OrderStatusI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'order_status', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class OrderStatusTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ProductI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'product', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -166,7 +166,7 @@ class ProductTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -151,7 +151,7 @@ class ResourceI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'resource', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null);
$this->addColumn('CHAPO', 'Chapo', 'LONGVARCHAR', false, null, null);

View File

@@ -101,7 +101,7 @@ class ResourceTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -141,7 +141,7 @@ class TaxI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
$this->addColumn('TITLE', 'Title', 'VARCHAR', false, 255, null);
$this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null);
} // initialize()

View File

@@ -131,7 +131,7 @@ class TaxRuleI18nTableMap extends TableMap
$this->setUseIdGenerator(false);
// columns
$this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'tax_rule', 'ID', true, null, null);
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US');
$this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_EN');
} // initialize()
/**

View File

@@ -111,7 +111,7 @@ class TaxRuleTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames

View File

@@ -101,7 +101,7 @@ class TaxTableMap extends TableMap
*
* @var string
*/
const DEFAULT_LOCALE = 'en_US';
const DEFAULT_LOCALE = 'en_EN';
/**
* holds an array of fieldnames