Merge branch 'master' of https://github.com/thelia/thelia into coupon

* 'master' of https://github.com/thelia/thelia: (33 commits)
  permissions
  finish contact process
  create contact form
  create example for mail usage
  permission cleanup
  change place where absolute url is create when rewritten url is enabled
  fix issue #43
  fix typo in product breadcrumb
  update countries list
  fix issue #35
  fix cartItem updateQuantity method
  add some verification on country default trigger
  not allowed to delete default country
  WIP : admin profiles
  fiw test suite
  clear cache when a module is removed
  end module removal
  create event object for module delete action
  update insert script
  new model
  ...

Conflicts:
	core/lib/Thelia/Controller/Admin/CouponController.php
This commit is contained in:
gmorel
2013-10-22 23:01:04 +02:00
128 changed files with 4095 additions and 1209 deletions

View File

@@ -74,7 +74,7 @@ class CartController extends BaseFrontController
$cartEvent->setQuantity($this->getRequest()->get("quantity"));
try {
$this->getDispatcher()->dispatch(TheliaEvents::CART_UPDATEITEM, $cartEvent);
$this->dispatch(TheliaEvents::CART_UPDATEITEM, $cartEvent);
$this->redirectSuccess();
} catch (PropelException $e) {

View File

@@ -58,7 +58,7 @@ class ContactController extends BaseFrontController
}
if ($error_message !== false) {
\Thelia\Log\Tlog::getInstance()->error(sprintf("Error during customer creation process : %s", $error_message));
\Thelia\Log\Tlog::getInstance()->error(sprintf('Error during sending contact mail : %s', $error_message));
$contactForm->setErrorMessage($error_message);

View File

@@ -0,0 +1,78 @@
<?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\Front;
use Thelia\Core\Event\Newsletter\NewsletterEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\NewsletterForm;
/**
* Class NewsletterController
* @package Thelia\Controller\Front
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*/
class NewsletterController extends BaseFrontController
{
public function subscribeAction()
{
$error_message = false;
$newsletterForm = new NewsletterForm($this->getRequest());
try {
$form = $this->validateForm($newsletterForm);
$event = new NewsletterEvent(
$form->get('email')->getData(),
$this->getRequest()->getSession()->getLang()->getLocale()
);
if (null !== $customer = $this->getSecurityContext()->getCustomerUser())
{
$event->setFirstname($customer->getFirstname());
$event->setLastname($customer->getLastname());
}
$this->dispatch(TheliaEvents::NEWSLETTER_SUBSCRIBE, $event);
} catch(\Exception $e) {
$error_message = $e->getMessage();
}
if($error_message !== false) {
\Thelia\Log\Tlog::getInstance()->error(sprintf('Error during newsletter subscription : %s', $error_message));
$newsletterForm->setErrorMessage($error_message);
$this->getParserContext()
->addForm($newsletterForm)
->setGeneralError($error_message)
;
} else {
$this->redirectToRoute('newsletter.success');
}
}
}