Merge branch 'master' into loops

This commit is contained in:
Etienne Roudeix
2013-09-12 17:21:13 +02:00
46 changed files with 1457 additions and 411 deletions

View File

@@ -23,7 +23,7 @@
namespace Thelia\Core\Event;
class AttributeValueCreateEvent extends AttributeValueEvent
class AttributeAvCreateEvent extends AttributeAvEvent
{
protected $title;
protected $locale;

View File

@@ -23,23 +23,23 @@
namespace Thelia\Core\Event;
class AttributeValueDeleteEvent extends AttributeValueEvent
class AttributeAvDeleteEvent extends AttributeAvEvent
{
protected $attributeValue_id;
protected $attributeAv_id;
public function __construct($attributeValue_id)
public function __construct($attributeAv_id)
{
$this->setAttributeValueId($attributeValue_id);
$this->setAttributeAvId($attributeAv_id);
}
public function getAttributeValueId()
public function getAttributeAvId()
{
return $this->attributeValue_id;
return $this->attributeAv_id;
}
public function setAttributeValueId($attributeValue_id)
public function setAttributeAvId($attributeAv_id)
{
$this->attributeValue_id = $attributeValue_id;
$this->attributeAv_id = $attributeAv_id;
return $this;
}

View File

@@ -24,28 +24,28 @@
namespace Thelia\Core\Event;
use Thelia\Model\AttributeAv;
class AttributeValueEvent extends ActionEvent
class AttributeAvEvent extends ActionEvent
{
protected $attributeValue = null;
protected $attributeAv = null;
public function __construct(AttributeAv $attributeValue = null)
public function __construct(AttributeAv $attributeAv = null)
{
$this->attributeValue = $attributeValue;
$this->attributeAv = $attributeAv;
}
public function hasAttributeValue()
public function hasAttributeAv()
{
return ! is_null($this->attributeValue);
return ! is_null($this->attributeAv);
}
public function getAttributeValue()
public function getAttributeAv()
{
return $this->attributeValue;
return $this->attributeAv;
}
public function setAttributeValue($attributeValue)
public function setAttributeAv($attributeAv)
{
$this->attributeValue = $attributeValue;
$this->attributeAv = $attributeAv;
return $this;
}

View File

@@ -23,27 +23,27 @@
namespace Thelia\Core\Event;
class AttributeValueUpdateEvent extends AttributeValueCreateEvent
class AttributeAvUpdateEvent extends AttributeAvCreateEvent
{
protected $attributeValue_id;
protected $attributeAv_id;
protected $description;
protected $chapo;
protected $postscriptum;
public function __construct($attributeValue_id)
public function __construct($attributeAv_id)
{
$this->setAttributeValueId($attributeValue_id);
$this->setAttributeAvId($attributeAv_id);
}
public function getAttributeValueId()
public function getAttributeAvId()
{
return $this->attributeValue_id;
return $this->attributeAv_id;
}
public function setAttributeValueId($attributeValue_id)
public function setAttributeAvId($attributeAv_id)
{
$this->attributeValue_id = $attributeValue_id;
$this->attributeAv_id = $attributeAv_id;
return $this;
}

View File

@@ -1,17 +1,35 @@
<?php
/**
* Created by JetBrains PhpStorm.
* User: manu
* Date: 16/08/13
* Time: 10:24
* To change this template use File | Settings | File Templates.
*/
/*************************************************************************************/
/* */
/* 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 Symfony\Component\EventDispatcher\Event;
use Thelia\Model\Customer;
/**
* Class CustomerCreateOrUpdateEvent
* @package Thelia\Core\Event
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class CustomerCreateOrUpdateEvent extends ActionEvent
{
//base parameters for creating new customer
@@ -32,6 +50,7 @@ class CustomerCreateOrUpdateEvent extends ActionEvent
protected $reseller;
protected $sponsor;
protected $discount;
protected $company;
/**
* @var \Thelia\Model\Customer
@@ -39,7 +58,7 @@ class CustomerCreateOrUpdateEvent extends ActionEvent
protected $customer;
/**
* @param int $title the title customer id
* @param int $title the title customer id
* @param string $firstname
* @param string $lastname
* @param string $address1
@@ -49,15 +68,16 @@ class CustomerCreateOrUpdateEvent extends ActionEvent
* @param string $cellphone
* @param string $zipcode
* @param string $city
* @param int $country the country id
* @param int $country the country id
* @param string $email
* @param string $password plain password, don't put hash password, it will hashes again
* @param $lang
* @param int $reseller if customer is a reseller
* @param int $sponsor customer's id sponsor
* @param int $reseller if customer is a reseller
* @param int $sponsor customer's id sponsor
* @param float $discount
* @param string $company
*/
public function __construct($title, $firstname, $lastname, $address1, $address2, $address3, $phone, $cellphone, $zipcode, $city, $country, $email, $password, $lang, $reseller, $sponsor, $discount)
public function __construct($title, $firstname, $lastname, $address1, $address2, $address3, $phone, $cellphone, $zipcode, $city, $country, $email, $password, $lang, $reseller, $sponsor, $discount, $company)
{
$this->address1 = $address1;
$this->address2 = $address2;
@@ -72,9 +92,18 @@ class CustomerCreateOrUpdateEvent extends ActionEvent
$this->cellphone = $cellphone;
$this->title = $title;
$this->zipcode = $zipcode;
$this->city = $city;
$this->reseller = $reseller;
$this->sponsor = $sponsor;
$this->discount = $discount;
$this->company = $company;
}
/**
* @return mixed
*/
public function getCompany()
{
return $this->company;
}
/**

View File

@@ -71,6 +71,11 @@ final class TheliaEvents
*/
const CUSTOMER_UPDATEACCOUNT = "action.updateCustomer";
/**
* sent on customer removal
*/
const CUSTOMER_DELETEACCOUNT = "action.deleteCustomer";
/**
* sent when a customer need a new password
*/
@@ -103,6 +108,16 @@ final class TheliaEvents
*/
const AFTER_UPDATECUSTOMER = "action.after_updateCustomer";
/**
* sent just before customer removal
*/
const BEFORE_DELETECUSTOMER = "action.before_updateCustomer";
/**
* sent just after customer removal
*/
const AFTER_DELETECUSTOMER = "action.after_deleteCustomer";
// -- ADDRESS MANAGEMENT ---------------------------------------------------------
/**
* sent for address creation
@@ -365,17 +380,17 @@ final class TheliaEvents
// -- Attributes values management ----------------------------------------
const ATTRIBUTE_VALUE_CREATE = "action.createAttributeValue";
const ATTRIBUTE_VALUE_UPDATE = "action.updateAttributeValue";
const ATTRIBUTE_VALUE_DELETE = "action.deleteAttributeValue";
const ATTRIBUTE_VALUE_UPDATE_POSITION = "action.updateAttributeValuePosition";
const ATTRIBUTE_AV_CREATE = "action.createAttributeAv";
const ATTRIBUTE_AV_UPDATE = "action.updateAttributeAv";
const ATTRIBUTE_AV_DELETE = "action.deleteAttributeAv";
const ATTRIBUTE_AV_UPDATE_POSITION = "action.updateAttributeAvPosition";
const BEFORE_CREATEATTRIBUTE_VALUE = "action.before_createAttributeValue";
const AFTER_CREATEATTRIBUTE_VALUE = "action.after_createAttributeValue";
const BEFORE_CREATEATTRIBUTE_AV = "action.before_createAttributeAv";
const AFTER_CREATEATTRIBUTE_AV = "action.after_createAttributeAv";
const BEFORE_UPDATEATTRIBUTE_VALUE = "action.before_updateAttributeValue";
const AFTER_UPDATEATTRIBUTE_VALUE = "action.after_updateAttributeValue";
const BEFORE_UPDATEATTRIBUTE_AV = "action.before_updateAttributeAv";
const AFTER_UPDATEATTRIBUTE_AV = "action.after_updateAttributeAv";
const BEFORE_DELETEATTRIBUTE_VALUE = "action.before_deleteAttributeValue";
const AFTER_DELETEATTRIBUTE_VALUE = "action.after_deleteAttributeValue";
const BEFORE_DELETEATTRIBUTE_AV = "action.before_deleteAttributeAv";
const AFTER_DELETEATTRIBUTE_AV = "action.after_deleteAttributeAv";
}

View File

@@ -63,7 +63,7 @@ class Address extends BaseLoop
),
'current'
),
Argument::createBooleanTypeArgument('default', false),
Argument::createBooleanTypeArgument('default'),
Argument::createIntListTypeArgument('exclude')
);
}
@@ -100,6 +100,8 @@ class Address extends BaseLoop
if ($default === true) {
$search->filterByIsDefault(1, Criteria::EQUAL);
} else if($default === false) {
$search->filterByIsDefault(0, Criteria::EQUAL);
}
$exclude = $this->getExclude();