Merge branch 'master' into frontend
This commit is contained in:
@@ -30,8 +30,8 @@ Requirements
|
|||||||
|
|
||||||
If you use Mac OSX, it still doesn't use php 5.4 as default php version... There are many solutions for you :
|
If you use Mac OSX, it still doesn't use php 5.4 as default php version... There are many solutions for you :
|
||||||
|
|
||||||
* use linux (the best one)
|
* use [phpbrew](https://github.com/c9s/phpbrew)
|
||||||
* use last MAMP version and put the php bin directory in your path :
|
* use last MAMP version and put the php bin directory in your path:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export PATH=/Applications/MAMP/bin/php/php5.4.x/bin/:$PATH
|
export PATH=/Applications/MAMP/bin/php/php5.4.x/bin/:$PATH
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
|||||||
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
|
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
|
||||||
use Thelia\Core\Event\Document\DocumentDeleteEvent;
|
use Thelia\Core\Event\Document\DocumentDeleteEvent;
|
||||||
use Thelia\Core\Event\Document\DocumentEvent;
|
use Thelia\Core\Event\Document\DocumentEvent;
|
||||||
|
use Thelia\Core\Event\UpdateFilePositionEvent;
|
||||||
use Thelia\Exception\ImageException;
|
use Thelia\Exception\ImageException;
|
||||||
use Thelia\Model\ConfigQuery;
|
use Thelia\Model\ConfigQuery;
|
||||||
use Thelia\Tools\FileManager;
|
use Thelia\Tools\FileManager;
|
||||||
@@ -195,6 +196,11 @@ class Document extends BaseCachedFile implements EventSubscriberInterface
|
|||||||
$event->setModelDocument($event->getModelDocument());
|
$event->setModelDocument($event->getModelDocument());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updatePosition(UpdateFilePositionEvent $event)
|
||||||
|
{
|
||||||
|
return $this->genericUpdatePosition($event->getQuery(), $event);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take care of deleting document in the database and file storage
|
* Take care of deleting document in the database and file storage
|
||||||
*
|
*
|
||||||
@@ -218,6 +224,7 @@ class Document extends BaseCachedFile implements EventSubscriberInterface
|
|||||||
TheliaEvents::DOCUMENT_DELETE => array("deleteDocument", 128),
|
TheliaEvents::DOCUMENT_DELETE => array("deleteDocument", 128),
|
||||||
TheliaEvents::DOCUMENT_SAVE => array("saveDocument", 128),
|
TheliaEvents::DOCUMENT_SAVE => array("saveDocument", 128),
|
||||||
TheliaEvents::DOCUMENT_UPDATE => array("updateDocument", 128),
|
TheliaEvents::DOCUMENT_UPDATE => array("updateDocument", 128),
|
||||||
|
TheliaEvents::DOCUMENT_UPDATE_POSITION => array("updatePosition", 128),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
|||||||
use Thelia\Core\Event\Image\ImageCreateOrUpdateEvent;
|
use Thelia\Core\Event\Image\ImageCreateOrUpdateEvent;
|
||||||
use Thelia\Core\Event\Image\ImageDeleteEvent;
|
use Thelia\Core\Event\Image\ImageDeleteEvent;
|
||||||
use Thelia\Core\Event\Image\ImageEvent;
|
use Thelia\Core\Event\Image\ImageEvent;
|
||||||
|
use Thelia\Core\Event\UpdateFilePositionEvent;
|
||||||
use Thelia\Model\ConfigQuery;
|
use Thelia\Model\ConfigQuery;
|
||||||
use Thelia\Tools\FileManager;
|
use Thelia\Tools\FileManager;
|
||||||
use Thelia\Tools\URL;
|
use Thelia\Tools\URL;
|
||||||
@@ -301,6 +302,11 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
|
|||||||
$event->setModelImage($event->getModelImage());
|
$event->setModelImage($event->getModelImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updatePosition(UpdateFilePositionEvent $event)
|
||||||
|
{
|
||||||
|
return $this->genericUpdatePosition($event->getQuery(), $event);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take care of deleting image in the database and file storage
|
* Take care of deleting image in the database and file storage
|
||||||
*
|
*
|
||||||
@@ -441,6 +447,7 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
|
|||||||
TheliaEvents::IMAGE_DELETE => array("deleteImage", 128),
|
TheliaEvents::IMAGE_DELETE => array("deleteImage", 128),
|
||||||
TheliaEvents::IMAGE_SAVE => array("saveImage", 128),
|
TheliaEvents::IMAGE_SAVE => array("saveImage", 128),
|
||||||
TheliaEvents::IMAGE_UPDATE => array("updateImage", 128),
|
TheliaEvents::IMAGE_UPDATE => array("updateImage", 128),
|
||||||
|
TheliaEvents::IMAGE_UPDATE_POSITION => array("updatePosition", 128),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,11 @@
|
|||||||
<requirement key="parentType">.*</requirement>
|
<requirement key="parentType">.*</requirement>
|
||||||
<requirement key="parentId">\d+</requirement>
|
<requirement key="parentId">\d+</requirement>
|
||||||
</route>
|
</route>
|
||||||
|
<route id="admin.image.update-position" path="/admin/image/type/{parentType}/{parentId}/update-position">
|
||||||
|
<default key="_controller">Thelia\Controller\Admin\FileController::updateImagePositionAction</default>
|
||||||
|
<requirement key="parentType">.*</requirement>
|
||||||
|
<requirement key="parentId">\d+</requirement>
|
||||||
|
</route>
|
||||||
<route id="admin.image.update.view" path="/admin/image/type/{parentType}/{imageId}/update" methods="get">
|
<route id="admin.image.update.view" path="/admin/image/type/{parentType}/{imageId}/update" methods="get">
|
||||||
<default key="_controller">Thelia\Controller\Admin\FileController::viewImageAction</default>
|
<default key="_controller">Thelia\Controller\Admin\FileController::viewImageAction</default>
|
||||||
<requirement key="parentType">.*</requirement>
|
<requirement key="parentType">.*</requirement>
|
||||||
@@ -90,6 +95,11 @@
|
|||||||
<requirement key="parentType">.*</requirement>
|
<requirement key="parentType">.*</requirement>
|
||||||
<requirement key="parentId">\d+</requirement>
|
<requirement key="parentId">\d+</requirement>
|
||||||
</route>
|
</route>
|
||||||
|
<route id="admin.document.update-position" path="/admin/document/type/{parentType}/{parentId}/update-position">
|
||||||
|
<default key="_controller">Thelia\Controller\Admin\FileController::updateDocumentPositionAction</default>
|
||||||
|
<requirement key="parentType">.*</requirement>
|
||||||
|
<requirement key="parentId">\d+</requirement>
|
||||||
|
</route>
|
||||||
<route id="admin.document.update.view" path="/admin/document/type/{parentType}/{documentId}/update" methods="get">
|
<route id="admin.document.update.view" path="/admin/document/type/{parentType}/{documentId}/update" methods="get">
|
||||||
<default key="_controller">Thelia\Controller\Admin\FileController::viewDocumentAction</default>
|
<default key="_controller">Thelia\Controller\Admin\FileController::viewDocumentAction</default>
|
||||||
<requirement key="parentType">.*</requirement>
|
<requirement key="parentType">.*</requirement>
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ namespace Thelia\Controller\Admin;
|
|||||||
|
|
||||||
use Propel\Runtime\Exception\PropelException;
|
use Propel\Runtime\Exception\PropelException;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
|
use Thelia\Core\Event\UpdateFilePositionEvent;
|
||||||
use Thelia\Core\HttpFoundation\Response;
|
use Thelia\Core\HttpFoundation\Response;
|
||||||
use Thelia\Core\Security\Resource\AdminResources;
|
use Thelia\Core\Security\Resource\AdminResources;
|
||||||
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
|
use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent;
|
||||||
@@ -519,6 +520,8 @@ class FileController extends BaseAdminController
|
|||||||
*/
|
*/
|
||||||
public function deleteImageAction($imageId, $parentType)
|
public function deleteImageAction($imageId, $parentType)
|
||||||
{
|
{
|
||||||
|
$message = null;
|
||||||
|
|
||||||
$this->checkAuth(AdminResources::retrieve($parentType), array(), AccessManager::UPDATE);
|
$this->checkAuth(AdminResources::retrieve($parentType), array(), AccessManager::UPDATE);
|
||||||
$this->checkXmlHttpRequest();
|
$this->checkXmlHttpRequest();
|
||||||
|
|
||||||
@@ -569,14 +572,134 @@ class FileController extends BaseAdminController
|
|||||||
'image'
|
'image'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$message = $this->getTranslator()
|
||||||
|
->trans(
|
||||||
|
'Fail to delete image for %id% with parent id %parentId% (Exception : %e%)',
|
||||||
|
array(
|
||||||
|
'%id%' => $imageDeleteEvent->getImageToDelete()->getId(),
|
||||||
|
'%parentId%' => $imageDeleteEvent->getImageToDelete()->getParentId(),
|
||||||
|
'%e%' => $e->getMessage()
|
||||||
|
),
|
||||||
|
'image'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(null === $message) {
|
||||||
$message = $this->getTranslator()
|
$message = $this->getTranslator()
|
||||||
->trans(
|
->trans(
|
||||||
'Images deleted successfully',
|
'Images deleted successfully',
|
||||||
array(),
|
array(),
|
||||||
'image'
|
'image'
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Response($message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateImagePositionAction($parentType, $parentId)
|
||||||
|
{
|
||||||
|
$message = null;
|
||||||
|
|
||||||
|
$imageId = $this->getRequest()->request->get('image_id');
|
||||||
|
$position = $this->getRequest()->request->get('position');
|
||||||
|
|
||||||
|
$this->checkAuth(AdminResources::retrieve($parentType), array(), AccessManager::UPDATE);
|
||||||
|
$this->checkXmlHttpRequest();
|
||||||
|
|
||||||
|
$fileManager = new FileManager($this->container);
|
||||||
|
$imageModelQuery = $fileManager->getImageModelQuery($parentType);
|
||||||
|
$model = $imageModelQuery->findPk($imageId);
|
||||||
|
|
||||||
|
if ($model === null || $position === null) {
|
||||||
|
return $this->pageNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Feed event
|
||||||
|
$imageUpdateImagePositionEvent = new UpdateFilePositionEvent(
|
||||||
|
$fileManager->getImageModelQuery($parentType),
|
||||||
|
$imageId,
|
||||||
|
UpdateFilePositionEvent::POSITION_ABSOLUTE,
|
||||||
|
$position
|
||||||
|
);
|
||||||
|
|
||||||
|
// Dispatch Event to the Action
|
||||||
|
try {
|
||||||
|
$this->dispatch(
|
||||||
|
TheliaEvents::IMAGE_UPDATE_POSITION,
|
||||||
|
$imageUpdateImagePositionEvent
|
||||||
|
);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
|
$message = $this->getTranslator()
|
||||||
|
->trans(
|
||||||
|
'Fail to update image position',
|
||||||
|
array(),
|
||||||
|
'image'
|
||||||
|
) . $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(null === $message) {
|
||||||
|
$message = $this->getTranslator()
|
||||||
|
->trans(
|
||||||
|
'Image position updated',
|
||||||
|
array(),
|
||||||
|
'image'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Response($message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateDocumentPositionAction($parentType, $parentId)
|
||||||
|
{
|
||||||
|
$message = null;
|
||||||
|
|
||||||
|
$documentId = $this->getRequest()->request->get('document_id');
|
||||||
|
$position = $this->getRequest()->request->get('position');
|
||||||
|
|
||||||
|
$this->checkAuth(AdminResources::retrieve($parentType), array(), AccessManager::UPDATE);
|
||||||
|
$this->checkXmlHttpRequest();
|
||||||
|
|
||||||
|
$fileManager = new FileManager($this->container);
|
||||||
|
$documentModelQuery = $fileManager->getDocumentModelQuery($parentType);
|
||||||
|
$model = $documentModelQuery->findPk($documentId);
|
||||||
|
|
||||||
|
if ($model === null || $position === null) {
|
||||||
|
return $this->pageNotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Feed event
|
||||||
|
$documentUpdateDocumentPositionEvent = new UpdateFilePositionEvent(
|
||||||
|
$fileManager->getDocumentModelQuery($parentType),
|
||||||
|
$documentId,
|
||||||
|
UpdateFilePositionEvent::POSITION_ABSOLUTE,
|
||||||
|
$position
|
||||||
|
);
|
||||||
|
|
||||||
|
// Dispatch Event to the Action
|
||||||
|
try {
|
||||||
|
$this->dispatch(
|
||||||
|
TheliaEvents::DOCUMENT_UPDATE_POSITION,
|
||||||
|
$documentUpdateDocumentPositionEvent
|
||||||
|
);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
|
$message = $this->getTranslator()
|
||||||
|
->trans(
|
||||||
|
'Fail to update document position',
|
||||||
|
array(),
|
||||||
|
'document'
|
||||||
|
) . $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(null === $message) {
|
||||||
|
$message = $this->getTranslator()
|
||||||
|
->trans(
|
||||||
|
'Document position updated',
|
||||||
|
array(),
|
||||||
|
'document'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return new Response($message);
|
return new Response($message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class SessionController extends BaseAdminController
|
|||||||
$this->getSecurityContext()->setAdminUser($user);
|
$this->getSecurityContext()->setAdminUser($user);
|
||||||
|
|
||||||
// Log authentication success
|
// Log authentication success
|
||||||
AdminLog::append("admin", "LOGIN", "Authentication successful", $request, $user);
|
AdminLog::append("admin", "LOGIN", "Authentication successful", $request, $user, false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FIXME: we have tou find a way to send cookie
|
* FIXME: we have tou find a way to send cookie
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ abstract class BaseController extends ContainerAware
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \Symfony\Component\HttpFoundation\Request
|
* @return \Thelia\Core\HttpFoundation\Request
|
||||||
*/
|
*/
|
||||||
protected function getRequest()
|
protected function getRequest()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -408,6 +408,7 @@ final class TheliaEvents
|
|||||||
* Save given documents
|
* Save given documents
|
||||||
*/
|
*/
|
||||||
const DOCUMENT_UPDATE = "action.updateDocument";
|
const DOCUMENT_UPDATE = "action.updateDocument";
|
||||||
|
const DOCUMENT_UPDATE_POSITION = "action.updateDocumentPosition";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete given document
|
* Delete given document
|
||||||
@@ -428,6 +429,7 @@ final class TheliaEvents
|
|||||||
* Save given images
|
* Save given images
|
||||||
*/
|
*/
|
||||||
const IMAGE_UPDATE = "action.updateImages";
|
const IMAGE_UPDATE = "action.updateImages";
|
||||||
|
const IMAGE_UPDATE_POSITION = "action.updateImagePosition";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete given image
|
* Delete given image
|
||||||
|
|||||||
60
core/lib/Thelia/Core/Event/UpdateFilePositionEvent.php
Normal file
60
core/lib/Thelia/Core/Event/UpdateFilePositionEvent.php
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<?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\Core\Event;
|
||||||
|
|
||||||
|
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||||
|
|
||||||
|
class UpdateFilePositionEvent extends UpdatePositionEvent
|
||||||
|
{
|
||||||
|
protected $query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ModelCriteria $query
|
||||||
|
* @param $object_id
|
||||||
|
* @param null $mode
|
||||||
|
* @param null $position
|
||||||
|
*/
|
||||||
|
public function __construct(ModelCriteria $query, $object_id, $mode, $position = null)
|
||||||
|
{
|
||||||
|
parent::__construct($object_id, $mode, $position);
|
||||||
|
|
||||||
|
$this->setQuery($query);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ModelCriteria $query
|
||||||
|
*/
|
||||||
|
public function setQuery(ModelCriteria $query)
|
||||||
|
{
|
||||||
|
$this->query = $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ModelCriteria|null
|
||||||
|
*/
|
||||||
|
public function getQuery()
|
||||||
|
{
|
||||||
|
return $this->query;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,6 +34,11 @@ use Symfony\Component\HttpFoundation\Request as BaseRequest;
|
|||||||
class Request extends BaseRequest
|
class Request extends BaseRequest
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private $excludeContent = array(
|
||||||
|
'username',
|
||||||
|
'password'
|
||||||
|
);
|
||||||
|
|
||||||
public function getProductId()
|
public function getProductId()
|
||||||
{
|
{
|
||||||
return $this->get("product_id");
|
return $this->get("product_id");
|
||||||
@@ -66,4 +71,17 @@ class Request extends BaseRequest
|
|||||||
{
|
{
|
||||||
return parent::getSession();
|
return parent::getSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function toString($withContent = true)
|
||||||
|
{
|
||||||
|
$string =
|
||||||
|
sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n".
|
||||||
|
$this->headers."\r\n";
|
||||||
|
|
||||||
|
if (true === $withContent) {
|
||||||
|
$string .= $this->getContent();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
namespace Thelia\Core\Security\Exception;
|
namespace Thelia\Core\Security\Exception;
|
||||||
|
|
||||||
class RessourceException extends \RuntimeException
|
class ResourceException extends \RuntimeException
|
||||||
{
|
{
|
||||||
const UNKNOWN_EXCEPTION = 0;
|
const UNKNOWN_EXCEPTION = 0;
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ class AdminLog extends BaseAdminLog
|
|||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param Base\Admin $adminUser
|
* @param Base\Admin $adminUser
|
||||||
*/
|
*/
|
||||||
public static function append($resource, $action, $message, Request $request, BaseAdminUser $adminUser = null) {
|
public static function append($resource, $action, $message, Request $request, BaseAdminUser $adminUser = null, $withRequestContent = true) {
|
||||||
|
|
||||||
$log = new AdminLog();
|
$log = new AdminLog();
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ class AdminLog extends BaseAdminLog
|
|||||||
->setResource($resource)
|
->setResource($resource)
|
||||||
->setAction($action)
|
->setAction($action)
|
||||||
->setMessage($message)
|
->setMessage($message)
|
||||||
->setRequest($request->__toString())
|
->setRequest($request->toString($withRequestContent))
|
||||||
;
|
;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -106,7 +106,11 @@ class Category extends BaseCategory
|
|||||||
public function preDelete(ConnectionInterface $con = null)
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
{
|
{
|
||||||
$this->dispatchEvent(TheliaEvents::BEFORE_DELETECATEGORY, new CategoryEvent($this));
|
$this->dispatchEvent(TheliaEvents::BEFORE_DELETECATEGORY, new CategoryEvent($this));
|
||||||
$this->reorderBeforeDelete();
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"parent" => $this->getParent(),
|
||||||
|
)
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class CategoryDocument extends BaseCategoryDocument
|
class CategoryDocument extends BaseCategoryDocument
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,4 +50,14 @@ class CategoryDocument extends BaseCategoryDocument
|
|||||||
{
|
{
|
||||||
return $this->getCategoryId();
|
return $this->getCategoryId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"category_id" => $this->getCategoryId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class CategoryImage extends BaseCategoryImage
|
class CategoryImage extends BaseCategoryImage
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,4 +53,13 @@ class CategoryImage extends BaseCategoryImage
|
|||||||
return $this->getCategoryId();
|
return $this->getCategoryId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"category_id" => $this->getCategoryId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class ContentDocument extends BaseContentDocument
|
class ContentDocument extends BaseContentDocument
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,4 +50,14 @@ class ContentDocument extends BaseContentDocument
|
|||||||
{
|
{
|
||||||
return $this->getContentId();
|
return $this->getContentId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"content_id" => $this->getContentId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class ContentImage extends BaseContentImage
|
class ContentImage extends BaseContentImage
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,4 +50,14 @@ class ContentImage extends BaseContentImage
|
|||||||
{
|
{
|
||||||
return $this->getContentId();
|
return $this->getContentId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"content_id" => $this->getContentId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,11 @@ class Folder extends BaseFolder
|
|||||||
public function preDelete(ConnectionInterface $con = null)
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
{
|
{
|
||||||
$this->dispatchEvent(TheliaEvents::BEFORE_DELETEFOLDER, new FolderEvent($this));
|
$this->dispatchEvent(TheliaEvents::BEFORE_DELETEFOLDER, new FolderEvent($this));
|
||||||
$this->reorderBeforeDelete();
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"parent" => $this->getParent(),
|
||||||
|
)
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class FolderDocument extends BaseFolderDocument
|
class FolderDocument extends BaseFolderDocument
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,4 +50,14 @@ class FolderDocument extends BaseFolderDocument
|
|||||||
{
|
{
|
||||||
return $this->getFolderId();
|
return $this->getFolderId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"folder_id" => $this->getFolderId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class FolderImage extends BaseFolderImage
|
class FolderImage extends BaseFolderImage
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,4 +50,14 @@ class FolderImage extends BaseFolderImage
|
|||||||
{
|
{
|
||||||
return $this->getFolderId();
|
return $this->getFolderId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"folder_id" => $this->getFolderId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class ProductDocument extends BaseProductDocument
|
class ProductDocument extends BaseProductDocument
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,4 +51,14 @@ class ProductDocument extends BaseProductDocument
|
|||||||
return $this->getProductId();
|
return $this->getProductId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"product_id" => $this->getProductId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
|
|
||||||
class ProductImage extends BaseProductImage
|
class ProductImage extends BaseProductImage
|
||||||
{
|
{
|
||||||
|
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||||
use \Thelia\Model\Tools\PositionManagementTrait;
|
use \Thelia\Model\Tools\PositionManagementTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,4 +50,14 @@ class ProductImage extends BaseProductImage
|
|||||||
{
|
{
|
||||||
return $this->getProductId();
|
return $this->getProductId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function preDelete(ConnectionInterface $con = null)
|
||||||
|
{
|
||||||
|
$this->reorderBeforeDelete(
|
||||||
|
array(
|
||||||
|
"product_id" => $this->getProductId(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -199,19 +199,26 @@ trait PositionManagementTrait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function reorderBeforeDelete()
|
protected function reorderBeforeDelete($fields = array())
|
||||||
{
|
{
|
||||||
// Find DATABASE_NAME constant
|
// Find DATABASE_NAME constant
|
||||||
$mapClassName = self::TABLE_MAP;
|
$mapClassName = self::TABLE_MAP;
|
||||||
|
|
||||||
$sql = sprintf("UPDATE `%s` SET position=(position-1) WHERE parent=:parent AND position>:position", $mapClassName::TABLE_NAME);
|
$data = array();
|
||||||
|
$whereCriteria = array();
|
||||||
|
|
||||||
|
foreach($fields as $field => $value) {
|
||||||
|
$whereCriteria[] = $field . '=:' . $field;
|
||||||
|
$data[':' . $field] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
$data[':position'] = $this->getPosition();
|
||||||
|
|
||||||
|
$sql = sprintf("UPDATE `%s` SET position=(position-1) WHERE " . (count($whereCriteria)>0 ? implode(" AND ", $whereCriteria) : '1') . " AND position>:position", $mapClassName::TABLE_NAME);
|
||||||
|
|
||||||
$con = Propel::getConnection($mapClassName::DATABASE_NAME);
|
$con = Propel::getConnection($mapClassName::DATABASE_NAME);
|
||||||
$statement = $con->prepare($sql);
|
$statement = $con->prepare($sql);
|
||||||
|
|
||||||
$statement->execute(array(
|
$statement->execute($data);
|
||||||
':parent' => $this->getParent(),
|
|
||||||
':position' => $this->getPosition()
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,10 +23,12 @@
|
|||||||
|
|
||||||
namespace Thelia\Module;
|
namespace Thelia\Module;
|
||||||
|
|
||||||
|
use Thelia\Model\Order;
|
||||||
|
|
||||||
interface PaymentModuleInterface extends BaseModuleInterface
|
interface PaymentModuleInterface extends BaseModuleInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function pay();
|
public function pay(Order $order);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ namespace Thelia\Tests\Action;
|
|||||||
|
|
||||||
use Propel\Runtime\ActiveQuery\Criteria;
|
use Propel\Runtime\ActiveQuery\Criteria;
|
||||||
use Thelia\Exception\UrlRewritingException;
|
use Thelia\Exception\UrlRewritingException;
|
||||||
use Thelia\Model\Base\ProductQuery;
|
use Thelia\Model\ProductQuery;
|
||||||
use Thelia\Model\Base\RewritingUrlQuery;
|
use Thelia\Model\RewritingUrlQuery;
|
||||||
use Thelia\Model\ConfigQuery;
|
use Thelia\Model\ConfigQuery;
|
||||||
use Thelia\Rewriting\RewritingResolver;
|
use Thelia\Rewriting\RewritingResolver;
|
||||||
use Thelia\Tools\URL;
|
use Thelia\Tools\URL;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ use Propel\Runtime\Connection\ConnectionInterface;
|
|||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Thelia\Model\ModuleImageQuery;
|
use Thelia\Model\ModuleImageQuery;
|
||||||
|
use Thelia\Model\Order;
|
||||||
use Thelia\Module\BaseModule;
|
use Thelia\Module\BaseModule;
|
||||||
use Thelia\Module\PaymentModuleInterface;
|
use Thelia\Module\PaymentModuleInterface;
|
||||||
|
|
||||||
@@ -55,7 +56,7 @@ class Cheque extends BaseModule implements PaymentModuleInterface
|
|||||||
return $this->dispatcher;
|
return $this->dispatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function pay()
|
public function pay(Order $order)
|
||||||
{
|
{
|
||||||
// no special process, waiting for the cheque.
|
// no special process, waiting for the cheque.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ return array(
|
|||||||
'Version %ver' => 'Version %ver',
|
'Version %ver' => 'Version %ver',
|
||||||
'View site' => 'View site',
|
'View site' => 'View site',
|
||||||
'View shop' => 'View shop',
|
'View shop' => 'View shop',
|
||||||
'Profil' => 'Profil',
|
'Profil' => 'Profile',
|
||||||
'Close administation session' => 'Close administation session',
|
'Close administation session' => 'Close administation session',
|
||||||
'Logout' => 'Logout',
|
'Logout' => 'Logout',
|
||||||
'Home' => 'Home',
|
'Home' => 'Home',
|
||||||
|
|||||||
@@ -222,8 +222,8 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<p>{intl l='© Thelia 2013'}
|
<p>{intl l='© Thelia 2013'}
|
||||||
- <a href="http://www.openstudio.fr/" target="_blank">{intl l='Published by OpenStudio'}</a>
|
- <a href="http://www.openstudio.fr/" target="_blank">{intl l='Published by OpenStudio'}</a>
|
||||||
- <a href="http://forum.thelia.net/" target="_blank">{intl l='Thelia support forum'}</a>
|
- <a href="http://thelia.net/forum" target="_blank">{intl l='Thelia support forum'}</a>
|
||||||
- <a href="http://contrib.thelia.net/" target="_blank">{intl l='Thelia contributions'}</a>
|
- <a href="#" target="_blank">{intl l='Thelia contributions'}</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{module_include location='in_footer'}
|
{module_include location='in_footer'}
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ $(function($){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Remove image on click
|
// Remove document on click
|
||||||
$.documentUploadManager.initDocumentDropZone = function() {
|
$.documentUploadManager.initDocumentDropZone = function() {
|
||||||
$.documentUploadManager.onClickDeleteDocument();
|
$.documentUploadManager.onClickDeleteDocument();
|
||||||
|
$.documentUploadManager.sortDocument();
|
||||||
|
|
||||||
var documentDropzone = new Dropzone("#documents-dropzone", {
|
var documentDropzone = new Dropzone("#documents-dropzone", {
|
||||||
dictDefaultMessage : $('.btn-browse').html(),
|
dictDefaultMessage : $('.btn-browse').html(),
|
||||||
@@ -64,10 +65,11 @@ $(function($){
|
|||||||
data
|
data
|
||||||
);
|
);
|
||||||
$.documentUploadManager.onClickDeleteDocument();
|
$.documentUploadManager.onClickDeleteDocument();
|
||||||
|
$.documentUploadManager.sortDocument();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Remove image on click
|
// Remove document on click
|
||||||
$.documentUploadManager.onClickDeleteDocument = function() {
|
$.documentUploadManager.onClickDeleteDocument = function() {
|
||||||
$('.document-manager .document-delete-btn').on('click', function (e) {
|
$('.document-manager .document-delete-btn').on('click', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -88,13 +90,66 @@ $(function($){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).done(function(data) {
|
}).done(function(data) {
|
||||||
$parent.parents('tr').remove();
|
$parent.parents('li').remove();
|
||||||
|
|
||||||
$(".document-manager .message").html(
|
$(".document-manager .message").html(
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* refresh position */
|
||||||
|
$( "#js-sort-document").children('li').each(function(position, element) {
|
||||||
|
$(element).find('.js-sorted-position').html(position + 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$.documentUploadManager.sortDocument = function() {
|
||||||
|
$( "#js-sort-document" ).sortable({
|
||||||
|
placeholder: "ui-sortable-placeholder col-sm-6 col-md-3",
|
||||||
|
change: function( event, ui ) {
|
||||||
|
/* refresh position */
|
||||||
|
var pickedElement = ui.item;
|
||||||
|
var position = 0;
|
||||||
|
$( "#js-sort-document").children('li').each(function(k, element) {
|
||||||
|
if($(element).data('sort-id') == pickedElement.data('sort-id')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
position++;
|
||||||
|
if($(element).is('.ui-sortable-placeholder')) {
|
||||||
|
pickedElement.find('.js-sorted-position').html(position);
|
||||||
|
} else {
|
||||||
|
$(element).find('.js-sorted-position').html(position);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
stop: function( event, ui ) {
|
||||||
|
/* update */
|
||||||
|
var newPosition = ui.item.find('.js-sorted-position').html();
|
||||||
|
var documentId = ui.item.data('sort-id');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: documentReorder,
|
||||||
|
data: {
|
||||||
|
document_id: documentId,
|
||||||
|
position: newPosition
|
||||||
|
},
|
||||||
|
statusCode: {
|
||||||
|
404: function() {
|
||||||
|
$(".document-manager .message").html(
|
||||||
|
documentReorderErrorMessage
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).done(function(data) {
|
||||||
|
$(".document-manager .message").html(
|
||||||
|
data
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$( "#js-sort-document" ).disableSelection();
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ $(function($){
|
|||||||
|
|
||||||
Dropzone.autoDiscover = false;
|
Dropzone.autoDiscover = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Remove image on click
|
// Remove image on click
|
||||||
$.imageUploadManager.initImageDropZone = function() {
|
$.imageUploadManager.initImageDropZone = function() {
|
||||||
|
|
||||||
$.imageUploadManager.onClickDeleteImage();
|
$.imageUploadManager.onClickDeleteImage();
|
||||||
|
$.imageUploadManager.sortImage();
|
||||||
|
|
||||||
var imageDropzone = new Dropzone("#images-dropzone", {
|
var imageDropzone = new Dropzone("#images-dropzone", {
|
||||||
dictDefaultMessage : $('.btn-browse').html(),
|
dictDefaultMessage : $('.btn-browse').html(),
|
||||||
@@ -65,6 +65,7 @@ $(function($){
|
|||||||
data
|
data
|
||||||
);
|
);
|
||||||
$.imageUploadManager.onClickDeleteImage();
|
$.imageUploadManager.onClickDeleteImage();
|
||||||
|
$.imageUploadManager.sortImage();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -95,8 +96,61 @@ $(function($){
|
|||||||
$(".image-manager .message").html(
|
$(".image-manager .message").html(
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* refresh position */
|
||||||
|
$( "#js-sort-image").children('li').each(function(position, element) {
|
||||||
|
$(element).find('.js-sorted-position').html(position + 1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$.imageUploadManager.sortImage = function() {
|
||||||
|
$( "#js-sort-image" ).sortable({
|
||||||
|
placeholder: "ui-sortable-placeholder col-sm-6 col-md-3",
|
||||||
|
change: function( event, ui ) {
|
||||||
|
/* refresh position */
|
||||||
|
var pickedElement = ui.item;
|
||||||
|
var position = 0;
|
||||||
|
$( "#js-sort-image").children('li').each(function(k, element) {
|
||||||
|
if($(element).data('sort-id') == pickedElement.data('sort-id')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
position++;
|
||||||
|
if($(element).is('.ui-sortable-placeholder')) {
|
||||||
|
pickedElement.find('.js-sorted-position').html(position);
|
||||||
|
} else {
|
||||||
|
$(element).find('.js-sorted-position').html(position);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
stop: function( event, ui ) {
|
||||||
|
/* update */
|
||||||
|
var newPosition = ui.item.find('.js-sorted-position').html();
|
||||||
|
var imageId = ui.item.data('sort-id');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: imageReorder,
|
||||||
|
data: {
|
||||||
|
image_id: imageId,
|
||||||
|
position: newPosition
|
||||||
|
},
|
||||||
|
statusCode: {
|
||||||
|
404: function() {
|
||||||
|
$(".image-manager .message").html(
|
||||||
|
imageReorderErrorMessage
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).done(function(data) {
|
||||||
|
$(".image-manager .message").html(
|
||||||
|
data
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$( "#js-sort-image" ).disableSelection();
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
7
templates/backOffice/default/assets/js/jquery-ui-1.10.3.custom.min.js
vendored
Executable file
7
templates/backOffice/default/assets/js/jquery-ui-1.10.3.custom.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -429,3 +429,16 @@ table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// document list style
|
||||||
|
ul.document-list {
|
||||||
|
> li {
|
||||||
|
padding: @table-condensed-cell-padding;
|
||||||
|
line-height: @line-height-base;
|
||||||
|
border-top: 1px solid @table-border-color;
|
||||||
|
&:nth-child(odd) {
|
||||||
|
background-color: @table-bg-accent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -305,8 +305,9 @@
|
|||||||
{javascripts file='assets/js/document-upload.js'}
|
{javascripts file='assets/js/document-upload.js'}
|
||||||
<script src="{$asset_url}"></script>
|
<script src="{$asset_url}"></script>
|
||||||
{/javascripts}
|
{/javascripts}
|
||||||
|
{javascripts file='assets/js/jquery-ui-1.10.3.custom.min.js'}
|
||||||
|
<script src="{$asset_url}"></script>
|
||||||
|
{/javascripts}
|
||||||
|
|
||||||
<script src="{url file='/tinymce/tinymce.min.js'}"></script>
|
<script src="{url file='/tinymce/tinymce.min.js'}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -200,6 +200,9 @@ form_content = {$smarty.capture.delete_folder_dialog nofilter}
|
|||||||
{javascripts file='assets/js/document-upload.js'}
|
{javascripts file='assets/js/document-upload.js'}
|
||||||
<script src="{$asset_url}"></script>
|
<script src="{$asset_url}"></script>
|
||||||
{/javascripts}
|
{/javascripts}
|
||||||
|
{javascripts file='assets/js/jquery-ui-1.10.3.custom.min.js'}
|
||||||
|
<script src="{$asset_url}"></script>
|
||||||
|
{/javascripts}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|||||||
@@ -286,6 +286,9 @@
|
|||||||
{javascripts file='assets/js/document-upload.js'}
|
{javascripts file='assets/js/document-upload.js'}
|
||||||
<script src="{$asset_url}"></script>
|
<script src="{$asset_url}"></script>
|
||||||
{/javascripts}
|
{/javascripts}
|
||||||
|
{javascripts file='assets/js/jquery-ui-1.10.3.custom.min.js'}
|
||||||
|
<script src="{$asset_url}"></script>
|
||||||
|
{/javascripts}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|||||||
@@ -32,5 +32,7 @@ Parameters:
|
|||||||
<script>
|
<script>
|
||||||
var documentDropZoneUrl = "{url path="/admin/document/type/$documentType/$parentId/save-ajax"}";
|
var documentDropZoneUrl = "{url path="/admin/document/type/$documentType/$parentId/save-ajax"}";
|
||||||
var documentListUrl = "{url path="/admin/document/type/$documentType/$parentId/list-ajax"}";
|
var documentListUrl = "{url path="/admin/document/type/$documentType/$parentId/list-ajax"}";
|
||||||
|
var documentReorder = "{url path="/admin/document/type/$documentType/$parentId/update-position"}";
|
||||||
var documentListErrorMessage = "{intl l='Can\'t load documents, please refresh this page.'}";
|
var documentListErrorMessage = "{intl l='Can\'t load documents, please refresh this page.'}";
|
||||||
|
var documentReorderErrorMessage = "{intl l='Can\'t reorder documents, please refresh this page.'}";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -7,16 +7,15 @@ Parameters:
|
|||||||
parentId = Document parent id, ex: category id
|
parentId = Document parent id, ex: category id
|
||||||
|
|
||||||
*}
|
*}
|
||||||
|
|
||||||
{ifloop rel="document"}
|
{ifloop rel="document"}
|
||||||
<table class="table table-striped table-condensed table-left-aligned">
|
<ul id="js-sort-document" class="list-unstyled document-list">
|
||||||
{loop type="document" name="document" source="{$documentType}" order="manual-reverse" source_id="{$parentId}"}
|
{loop type="document" name="document" source="{$documentType}" order="manual" source_id="{$parentId}"}
|
||||||
<tr>
|
<li class="clearfix ui-state-default" data-sort-id="{$ID}">
|
||||||
<td>
|
<a href="{$DOCUMENT_PATH}" title="{$TITLE}" class="pull-left" target="_blank">{$TITLE}</a>
|
||||||
<a href="{$DOCUMENT_PATH}" title="{$TITLE}" class="" target="_blank">{$TITLE}</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
<div class="btn-group pull-right">
|
||||||
<div class="btn-group">
|
<a class="image-update-btn btn btn-default btn-xs disabled js-sorted-position" href="#">{$POSITION}</a>
|
||||||
<a class="document-update-btn btn btn-default btn-xs" href="{url path="/admin/document/type/$documentType/$ID/update"}" data-error-message="{intl l='Please retry'}">
|
<a class="document-update-btn btn btn-default btn-xs" href="{url path="/admin/document/type/$documentType/$ID/update"}" data-error-message="{intl l='Please retry'}">
|
||||||
<span class="glyphicon glyphicon-edit"></span>
|
<span class="glyphicon glyphicon-edit"></span>
|
||||||
</a>
|
</a>
|
||||||
@@ -24,11 +23,11 @@ Parameters:
|
|||||||
<span class="glyphicon glyphicon-trash"></span>
|
<span class="glyphicon glyphicon-trash"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<td>
|
</li>
|
||||||
</tr>
|
|
||||||
{/loop}
|
{/loop}
|
||||||
</table>
|
</ul>
|
||||||
{/ifloop}
|
{/ifloop}
|
||||||
|
|
||||||
{elseloop rel="document"}
|
{elseloop rel="document"}
|
||||||
<div class="alert alert-info">{intl l='There is no documents attached to this %type.' type=$documentType}</div>
|
<div class="alert alert-info">{intl l='There is no documents attached to this %type.' type=$documentType}</div>
|
||||||
{/elseloop}
|
{/elseloop}
|
||||||
|
|||||||
@@ -32,5 +32,7 @@ Parameters:
|
|||||||
<script>
|
<script>
|
||||||
var imageDropZoneUrl = "{url path="/admin/image/type/$imageType/$parentId/save-ajax"}";
|
var imageDropZoneUrl = "{url path="/admin/image/type/$imageType/$parentId/save-ajax"}";
|
||||||
var imageListUrl = "{url path="/admin/image/type/$imageType/$parentId/list-ajax"}";
|
var imageListUrl = "{url path="/admin/image/type/$imageType/$parentId/list-ajax"}";
|
||||||
|
var imageReorder = "{url path="/admin/image/type/$imageType/$parentId/update-position"}";
|
||||||
var imageListErrorMessage = "{intl l='Can\'t load images, please refresh this page.'}";
|
var imageListErrorMessage = "{intl l='Can\'t load images, please refresh this page.'}";
|
||||||
|
var imageReorderErrorMessage = "{intl l='Can\'t reorder images, please refresh this page.'}";
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,14 +9,15 @@ Parameters:
|
|||||||
*}
|
*}
|
||||||
|
|
||||||
{ifloop rel="image"}
|
{ifloop rel="image"}
|
||||||
<div class="row">
|
<ul id="js-sort-image" class="row list-unstyled">
|
||||||
{loop type="image" name="image" source="{$imageType}" order="manual-reverse" source_id="{$parentId}" width="200" height="100" resize_mode="borders"}
|
{loop type="image" name="image" source="{$imageType}" order="manual" source_id="{$parentId}" width="200" height="100" resize_mode="borders"}
|
||||||
<div class="col-sm-6 col-md-3" >
|
<li class="col-sm-6 col-md-3 ui-state-default" data-sort-id="{$ID}">
|
||||||
<a href="{url path="/admin/image/type/$imageType/$ID/update"}" alt="{intl l='Update this image'}" class="thumbnail">
|
<a href="{url path="/admin/image/type/$imageType/$ID/update"}" alt="{intl l='Update this image'}" class="thumbnail">
|
||||||
<img src="{$IMAGE_URL}" alt="{$TITLE}">
|
<img src="{$IMAGE_URL}" alt="{$TITLE}">
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="btn-group" >
|
<div class="btn-group" >
|
||||||
|
<a class="image-update-btn btn btn-default btn-xs disabled js-sorted-position" href="#">{$POSITION}</a>
|
||||||
<a class="image-update-btn btn btn-default btn-xs" href="{url path="/admin/image/type/$imageType/$ID/update"}" data-error-message="{intl l='Please retry'}">
|
<a class="image-update-btn btn btn-default btn-xs" href="{url path="/admin/image/type/$imageType/$ID/update"}" data-error-message="{intl l='Please retry'}">
|
||||||
<span class="glyphicon glyphicon-edit"></span>
|
<span class="glyphicon glyphicon-edit"></span>
|
||||||
</a>
|
</a>
|
||||||
@@ -24,9 +25,9 @@ Parameters:
|
|||||||
<span class="glyphicon glyphicon-trash"></span>
|
<span class="glyphicon glyphicon-trash"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</li>
|
||||||
{/loop}
|
{/loop}
|
||||||
</div>
|
</ul>
|
||||||
{/ifloop}
|
{/ifloop}
|
||||||
{elseloop rel="image"}
|
{elseloop rel="image"}
|
||||||
<div class="alert alert-info">{intl l='There is no images attached to this %type.' type=$imageType}</div>
|
<div class="alert alert-info">{intl l='There is no images attached to this %type.' type=$imageType}</div>
|
||||||
|
|||||||
@@ -136,14 +136,15 @@
|
|||||||
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
|
{javascripts file='assets/js/bootstrap-editable/bootstrap-editable.js'}
|
||||||
<script src="{$asset_url}"></script>
|
<script src="{$asset_url}"></script>
|
||||||
{/javascripts}
|
{/javascripts}
|
||||||
|
|
||||||
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
|
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
|
||||||
<script src="{$asset_url}"></script>
|
<script src="{$asset_url}"></script>
|
||||||
{/javascripts}
|
{/javascripts}
|
||||||
|
|
||||||
{javascripts file='assets/js/jquery.typewatch.js'}
|
{javascripts file='assets/js/jquery.typewatch.js'}
|
||||||
<script src="{$asset_url}"></script>
|
<script src="{$asset_url}"></script>
|
||||||
{/javascripts}
|
{/javascripts}
|
||||||
|
{javascripts file='assets/js/jquery-ui-1.10.3.custom.min.js'}
|
||||||
|
<script src="{$asset_url}"></script>
|
||||||
|
{/javascripts}
|
||||||
|
|
||||||
<script src="{url file='/tinymce/tinymce.min.js'}"></script>
|
<script src="{url file='/tinymce/tinymce.min.js'}"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ return array(
|
|||||||
'Email address' => 'Adresse e-mail',
|
'Email address' => 'Adresse e-mail',
|
||||||
'Email Address' => 'Adresse e-mail',
|
'Email Address' => 'Adresse e-mail',
|
||||||
'Follow us' => 'Suivez-nous',
|
'Follow us' => 'Suivez-nous',
|
||||||
|
'Follow us introduction' => 'Sur les réseaux :',
|
||||||
'Forgot your Password?' => 'Mot de passe oublié ?',
|
'Forgot your Password?' => 'Mot de passe oublié ?',
|
||||||
'Free shipping' => 'Livraison gratuite',
|
'Free shipping' => 'Livraison gratuite',
|
||||||
'Go home' => 'Retour à l\'accueil',
|
'Go home' => 'Retour à l\'accueil',
|
||||||
@@ -81,7 +82,7 @@ return array(
|
|||||||
'Main Navigation' => 'Navigation principale',
|
'Main Navigation' => 'Navigation principale',
|
||||||
'Minimum 2 characters.' => '2 caractères minimum.',
|
'Minimum 2 characters.' => '2 caractères minimum.',
|
||||||
'missing or invalid data' => 'Information éronnée ou incomplète',
|
'missing or invalid data' => 'Information éronnée ou incomplète',
|
||||||
'Multi-payment plateform' => 'Plateforme multipaiement',// bizarre ?
|
'Multi-payment platform' => 'Plateforme de paiement en ligne',// bizarre ?
|
||||||
'My Account' => 'Mon compte',
|
'My Account' => 'Mon compte',
|
||||||
'My Address book' => 'Mon carnet d\'adresses',
|
'My Address book' => 'Mon carnet d\'adresses',
|
||||||
'My Address Books' => 'Mes carnets d\'adresses',
|
'My Address Books' => 'Mes carnets d\'adresses',
|
||||||
@@ -98,6 +99,7 @@ return array(
|
|||||||
'Next' => 'Suivant',
|
'Next' => 'Suivant',
|
||||||
'Next' => 'Suivant',
|
'Next' => 'Suivant',
|
||||||
'No articles currently' => 'Actuellement aucun article',
|
'No articles currently' => 'Actuellement aucun article',
|
||||||
|
'No, I am a new customer.' => 'Non, je suis un nouveau client.',
|
||||||
'No products available in this category' => 'Aucun produit dans cette catégorie.',
|
'No products available in this category' => 'Aucun produit dans cette catégorie.',
|
||||||
'No results found' => 'Aucun résultat',
|
'No results found' => 'Aucun résultat',
|
||||||
'No' => 'Non',
|
'No' => 'Non',
|
||||||
@@ -129,7 +131,8 @@ return array(
|
|||||||
'Placeholder lastname' => 'Nom de famille',
|
'Placeholder lastname' => 'Nom de famille',
|
||||||
'Placeholder phone' => 'Téléphone',
|
'Placeholder phone' => 'Téléphone',
|
||||||
'Placeholder zipcode' => 'Code postal',
|
'Placeholder zipcode' => 'Code postal',
|
||||||
'Please enter your email address below.' => 'Veuillez saisir votre adresse e-amil ci-dessous.',
|
'Please enter your email address' => 'Veuillez saisir votre adresse e-mail',
|
||||||
|
'Please enter your email address below.' => 'Veuillez saisir votre adresse e-mail ci-dessous.',
|
||||||
'Position' => 'Position',
|
'Position' => 'Position',
|
||||||
'Previous product' => 'Produits précédents',
|
'Previous product' => 'Produits précédents',
|
||||||
'Previous' => 'Précédent',
|
'Previous' => 'Précédent',
|
||||||
@@ -201,6 +204,7 @@ return array(
|
|||||||
'View' => 'Voir',
|
'View' => 'Voir',
|
||||||
'Warning' => 'Attention',
|
'Warning' => 'Attention',
|
||||||
'Yes' => 'Oui',
|
'Yes' => 'Oui',
|
||||||
|
'Yes, I have a password :' => 'Oui, j\'ai déjà un mot de passe',
|
||||||
'You are here:' => 'Vous êtes ici :',
|
'You are here:' => 'Vous êtes ici :',
|
||||||
'You choose to pay by' => 'Vous avez choisi de payer par',
|
'You choose to pay by' => 'Vous avez choisi de payer par',
|
||||||
'You don\'t have orders yet.' => 'Vous n\'avez pas encore de commande.',
|
'You don\'t have orders yet.' => 'Vous n\'avez pas encore de commande.',
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
{/loop}
|
{/loop}
|
||||||
{/loop}
|
{/loop}
|
||||||
{loop name="brand.feature" type="feature" product="{$ID}" title="isbn"}
|
{loop name="brand.feature" type="feature" product="{$ID}" title="isbn"}
|
||||||
{loop name="brand.value" type="feature_value" feature="{$ID}" product=$product_id}
|
{loop name="brand.value" type="feature_value" feature="{$ID}" product="{product attr="id"}"}
|
||||||
<meta itemprop="productID" content="isbn:{$TITLE}">
|
<meta itemprop="productID" content="isbn:{$TITLE}">
|
||||||
{/loop}
|
{/loop}
|
||||||
{/loop}
|
{/loop}
|
||||||
|
|||||||
Reference in New Issue
Block a user