manage lang for customer

This commit is contained in:
Manuel Raynaud
2013-07-04 18:21:24 +02:00
parent b7a8648c10
commit ca44544f84
4 changed files with 12 additions and 22 deletions

View File

@@ -68,7 +68,8 @@ class Customer implements EventSubscriberInterface
$data["zipcode"],
$data["country"],
$data["email"],
$data["password"]
$data["password"],
$request->getSession()->get("lang")
);
} catch (\PropelException $e) {
Tlog::getInstance()->error(sprintf('error during creating customer on action/createCustomer with message "%s"', $e->getMessage()));

View File

@@ -76,6 +76,7 @@ class TheliaHttpKernel extends HttpKernel
{
//$request->headers->set('X-Php-Ob-Level', ob_get_level());
$request = $this->initSession($request);
$this->initParam($request);
$this->container->enterScope('request');
$this->container->set('request', $request, 'request');

View File

@@ -45,7 +45,7 @@ class Customer extends BaseCustomer
* @param null $sponsor
* @param int $discount
*/
public function createOrUpdate($titleId, $firstname, $lastname, $address1, $address2, $address3, $phone, $cellphone, $zipcode, $countryId, $email, $plainPassword = null, $reseller = 0, $sponsor = null, $discount = 0 )
public function createOrUpdate($titleId, $firstname, $lastname, $address1, $address2, $address3, $phone, $cellphone, $zipcode, $countryId, $email, $plainPassword = null, $lang = null, $reseller = 0, $sponsor = null, $discount = 0)
{
$this
->setCustomerTitleId($titleId)
@@ -63,9 +63,14 @@ class Customer extends BaseCustomer
->setReseller($reseller)
->setSponsor($sponsor)
->setDiscount($discount)
->save()
;
if(!is_null($lang)) {
$this->setLang($lang);
}
$this->save();
}
public function preInsert(\PropelPDO $con = null)

View File

@@ -13,22 +13,7 @@ An image from asset directory :
jQuery data: <span id="jquery_block"></span>
</div>
<div>
<p>Category loop example</p>
<ul>
{loop type="category" name="catloop1"}
<li>{$__COUNT__}/{$__TOTAL__} : {$ID} {$TITLE}, children: {$NB_CHILD}
{ifloop rel="inner1"}
<ul>
{loop type="category" name="inner1" parent="{$ID}"}
<li>Sub cat {$ID} (parent is {$PARENT}): {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
</li>
{/loop}
</ul>
</div>
<div>
<p>Conditional example #1</p>
@@ -66,9 +51,7 @@ An image from asset directory :
{elseloop rel="catloop2"}
<p>... but catloop2 is still empty :-)</p>
{/elseloop}
{ifloop rel="catloop1"}
<p>... and catloop1 is still NOT empty :-)</p>
{/ifloop}
</div>
<div>