Merge branch 'master' into tinymce

Conflicts:
	local/modules/Tinymce/templates/backOffice/default/include/tinymce_init.tpl
This commit is contained in:
Franck Allimant
2014-06-19 00:16:21 +02:00
311 changed files with 28672 additions and 1157 deletions

View File

@@ -17,6 +17,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Template\ParserInterface;
use Thelia\Log\Tlog;
use Thelia\Mailer\MailerFactory;
use Thelia\Model\ConfigQuery;
use Thelia\Model\MessageQuery;
@@ -47,7 +48,7 @@ class SendMail implements EventSubscriberInterface
$order = $event->getOrder();
$colissimo = new Colissimo();
if ($order->getStatusId() == OrderStatus::CODE_SENT && $order->getDeliveryModuleId() == $colissimo->getModuleModel()->getId()) {
if ($order->isSent() && $order->getDeliveryModuleId() == $colissimo->getModuleModel()->getId()) {
$contact_email = ConfigQuery::read('store_email');
if ($contact_email) {
@@ -83,6 +84,12 @@ class SendMail implements EventSubscriberInterface
$message->buildMessage($this->parser, $instance);
$this->mailer->send($instance);
Tlog::getInstance()->debug("Colissimo shipping message sent to customer ".$customer->getEmail());
}
else {
$customer = $order->getCustomer();
Tlog::getInstance()->debug("Colissimo shipping message no contact email customer_id", $customer->getId());
}
}
}
@@ -113,4 +120,4 @@ class SendMail implements EventSubscriberInterface
TheliaEvents::ORDER_UPDATE_STATUS => array("updateStatus", 128)
);
}
}
}

View File

@@ -160,6 +160,11 @@
<default key="_view">order-invoice</default>
</route>
<route id="order.coupon.clear" path="/order/clear-coupons">
<default key="_controller">Front\Controller\CouponController::clearAllCouponsAction</default>
<default key="_view">order-invoice</default>
</route>
<route id="order.payment.process" path="/order/pay">
<default key="_controller">Front\Controller\OrderController::pay</default>
</route>

View File

@@ -174,10 +174,10 @@ class CartController extends BaseFrontController
$order = $this->getSession()->getOrder();
if (null !== $order) {
$deliveryModule = $order->getModuleRelatedByDeliveryModuleId();
$deliveryAddress = AddressQuery::create()->findPk($order->chosenDeliveryAddress);
$deliveryAddress = AddressQuery::create()->findPk($order->getChoosenDeliveryAddress());
if (null !== $deliveryModule && null !== $deliveryAddress) {
$moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode()));
$moduleInstance = $deliveryModule->getModuleInstance($this->container);
$orderEvent = new OrderEvent($order);

View File

@@ -46,7 +46,8 @@ class ContactController extends BaseFrontController
$form = $this->validateForm($contactForm);
$message = \Swift_Message::newInstance($form->get('subject')->getData())
->addFrom($form->get('email')->getData(), $form->get('name')->getData())
->addFrom(ConfigQuery::read("store_email"), $form->get('name')->getData())
->addReplyTo($form->get('email')->getData(), $form->get('name')->getData())
->addTo(ConfigQuery::read('store_email'), ConfigQuery::read('store_name'))
->setBody($form->get('message')->getData())
;

View File

@@ -40,9 +40,16 @@ use Thelia\Module\Exception\DeliveryException;
*/
class CouponController extends BaseFrontController
{
/**
* Clear all coupons.
*/
public function clearAllCouponsAction() {
// Dispatch Event to the Action
$this->getDispatcher()->dispatch(TheliaEvents::COUPON_CLEAR_ALL);
}
/**
* Test Coupon consuming
* Coupon consuming
*/
public function consumeAction()
{
@@ -69,12 +76,14 @@ class CouponController extends BaseFrontController
/* recalculate postage amount */
$order = $this->getSession()->getOrder();
if (null !== $order) {
$deliveryModule = $order->getModuleRelatedByDeliveryModuleId();
$deliveryAddress = AddressQuery::create()->findPk($order->chosenDeliveryAddress);
$deliveryAddress = AddressQuery::create()->findPk($order->getChoosenDeliveryAddress());
if (null !== $deliveryModule && null !== $deliveryAddress) {
$moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode()));
$moduleInstance = $deliveryModule->getModuleInstance($this->container);
$orderEvent = new OrderEvent($order);

View File

@@ -18,7 +18,7 @@ use Thelia\Controller\Front\BaseFrontController;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Core\HttpFoundation\Response;
use Thelia\Log\Tlog;
use Thelia\Model\Base\FolderQuery;
use Thelia\Model\FolderQuery;
use Thelia\Model\CategoryQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Model\Folder;

View File

@@ -88,7 +88,8 @@ class OrderController extends BaseFrontController
}
/* get postage amount */
$moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode()));
$moduleInstance = $deliveryModule->getModuleInstance($this->container);
$postage = $moduleInstance->getPostage($deliveryAddress->getCountry());
$orderEvent = $this->getOrderEvent();