Merge branch 'master' of https://github.com/thelia/thelia
This commit is contained in:
@@ -25,6 +25,7 @@ namespace Thelia\Action;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Thelia\Core\Event\Administrator\AdministratorEvent;
|
||||
use Thelia\Core\Event\Administrator\AdministratorUpdatePasswordEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Model\Admin as AdminModel;
|
||||
use Thelia\Model\AdminQuery;
|
||||
@@ -92,15 +93,23 @@ class Administrator extends BaseAction implements EventSubscriberInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function updatePassword(AdministratorUpdatePasswordEvent $event)
|
||||
{
|
||||
$admin = $event->getAdmin();
|
||||
$admin->setPassword($event->getPassword())
|
||||
->save();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return array(
|
||||
TheliaEvents::ADMINISTRATOR_CREATE => array("create", 128),
|
||||
TheliaEvents::ADMINISTRATOR_UPDATE => array("update", 128),
|
||||
TheliaEvents::ADMINISTRATOR_DELETE => array("delete", 128),
|
||||
TheliaEvents::ADMINISTRATOR_CREATE => array('create', 128),
|
||||
TheliaEvents::ADMINISTRATOR_UPDATE => array('update', 128),
|
||||
TheliaEvents::ADMINISTRATOR_DELETE => array('delete', 128),
|
||||
TheliaEvents::ADMINISTRATOR_UPDATEPASSWORD => array('updatePassword', 128)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,10 @@ class BaseAction
|
||||
/**
|
||||
* Changes object position, selecting absolute ou relative change.
|
||||
*
|
||||
* @param $query the query to retrieve the object to move
|
||||
* @param ModelCriteria $query
|
||||
* @param UpdatePositionEvent $event
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function genericUpdatePosition(ModelCriteria $query, UpdatePositionEvent $event)
|
||||
{
|
||||
@@ -71,18 +73,4 @@ class BaseAction
|
||||
return $object->movePositionDown();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to append a message to the admin log.
|
||||
*
|
||||
* @param string $message
|
||||
*/
|
||||
public function adminLogAppend($message)
|
||||
{
|
||||
AdminLog::append(
|
||||
$message,
|
||||
$this->container->get('request'),
|
||||
$this->container->get('thelia.securityContext')->getAdminUser()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,18 +143,6 @@ class Document extends BaseCachedFile implements EventSubscriberInterface
|
||||
*/
|
||||
public function saveDocument(DocumentCreateOrUpdateEvent $event)
|
||||
{
|
||||
$this->adminLogAppend(
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Saving documents for %parentName% parent id %parentId% (%parentType%)',
|
||||
array(
|
||||
'%parentName%' => $event->getParentName(),
|
||||
'%parentId%' => $event->getParentId(),
|
||||
'%parentType%' => $event->getDocumentType()
|
||||
),
|
||||
'document'
|
||||
)
|
||||
);
|
||||
|
||||
$fileManager = new FileManager($this->container);
|
||||
$model = $event->getModelDocument();
|
||||
|
||||
@@ -187,18 +175,6 @@ class Document extends BaseCachedFile implements EventSubscriberInterface
|
||||
*/
|
||||
public function updateDocument(DocumentCreateOrUpdateEvent $event)
|
||||
{
|
||||
$this->adminLogAppend(
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Updating documents for %parentName% parent id %parentId% (%parentType%)',
|
||||
array(
|
||||
'%parentName%' => $event->getParentName(),
|
||||
'%parentId%' => $event->getParentId(),
|
||||
'%parentType%' => $event->getDocumentType()
|
||||
),
|
||||
'image'
|
||||
)
|
||||
);
|
||||
|
||||
if (null !== $event->getUploadedFile()) {
|
||||
$event->getModelDocument()->setTitle($event->getUploadedFile()->getClientOriginalName());
|
||||
}
|
||||
@@ -231,33 +207,7 @@ class Document extends BaseCachedFile implements EventSubscriberInterface
|
||||
{
|
||||
$fileManager = new FileManager($this->container);
|
||||
|
||||
try {
|
||||
$fileManager->deleteFile($event->getDocumentToDelete(), $event->getDocumentType(), FileManager::FILE_TYPE_DOCUMENTS);
|
||||
|
||||
$this->adminLogAppend(
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Deleting document for %id% with parent id %parentId%',
|
||||
array(
|
||||
'%id%' => $event->getDocumentToDelete()->getId(),
|
||||
'%parentId%' => $event->getDocumentToDelete()->getParentId(),
|
||||
),
|
||||
'document'
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
$this->adminLogAppend(
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Fail to delete document for %id% with parent id %parentId% (Exception : %e%)',
|
||||
array(
|
||||
'%id%' => $event->getDocumentToDelete()->getId(),
|
||||
'%parentId%' => $event->getDocumentToDelete()->getParentId(),
|
||||
'%e%' => $e->getMessage()
|
||||
),
|
||||
'document'
|
||||
)
|
||||
);
|
||||
throw $e;
|
||||
}
|
||||
$fileManager->deleteFile($event->getDocumentToDelete(), $event->getDocumentType(), FileManager::FILE_TYPE_DOCUMENTS);
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
|
||||
@@ -254,18 +254,6 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
|
||||
*/
|
||||
public function saveImage(ImageCreateOrUpdateEvent $event)
|
||||
{
|
||||
$this->adminLogAppend(
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Saving images for %parentName% parent id %parentId% (%parentType%)',
|
||||
array(
|
||||
'%parentName%' => $event->getParentName(),
|
||||
'%parentId%' => $event->getParentId(),
|
||||
'%parentType%' => $event->getImageType()
|
||||
),
|
||||
'image'
|
||||
)
|
||||
);
|
||||
|
||||
$fileManager = new FileManager($this->container);
|
||||
$model = $event->getModelImage();
|
||||
|
||||
@@ -297,18 +285,6 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
|
||||
*/
|
||||
public function updateImage(ImageCreateOrUpdateEvent $event)
|
||||
{
|
||||
$this->adminLogAppend(
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Updating images for %parentName% parent id %parentId% (%parentType%)',
|
||||
array(
|
||||
'%parentName%' => $event->getParentName(),
|
||||
'%parentId%' => $event->getParentId(),
|
||||
'%parentType%' => $event->getImageType()
|
||||
),
|
||||
'image'
|
||||
)
|
||||
);
|
||||
|
||||
$fileManager = new FileManager($this->container);
|
||||
// Copy and save file
|
||||
if ($event->getUploadedFile()) {
|
||||
@@ -337,33 +313,7 @@ class Image extends BaseCachedFile implements EventSubscriberInterface
|
||||
{
|
||||
$fileManager = new FileManager($this->container);
|
||||
|
||||
try {
|
||||
$fileManager->deleteFile($event->getImageToDelete(), $event->getImageType(), FileManager::FILE_TYPE_IMAGES);
|
||||
|
||||
$this->adminLogAppend(
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Deleting image for %id% with parent id %parentId%',
|
||||
array(
|
||||
'%id%' => $event->getImageToDelete()->getId(),
|
||||
'%parentId%' => $event->getImageToDelete()->getParentId(),
|
||||
),
|
||||
'image'
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
$this->adminLogAppend(
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Fail to delete image for %id% with parent id %parentId% (Exception : %e%)',
|
||||
array(
|
||||
'%id%' => $event->getImageToDelete()->getId(),
|
||||
'%parentId%' => $event->getImageToDelete()->getParentId(),
|
||||
'%e%' => $e->getMessage()
|
||||
),
|
||||
'image'
|
||||
)
|
||||
);
|
||||
throw $e;
|
||||
}
|
||||
$fileManager->deleteFile($event->getImageToDelete(), $event->getImageType(), FileManager::FILE_TYPE_IMAGES);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
102
core/lib/Thelia/Command/AdminUpdatePasswordCommand.php
Normal file
102
core/lib/Thelia/Command/AdminUpdatePasswordCommand.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?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\Command;
|
||||
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Thelia\Core\Event\Administrator\AdministratorUpdatePasswordEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Model\AdminQuery;
|
||||
use Thelia\Tools\Password;
|
||||
|
||||
|
||||
/**
|
||||
* command line for updating admin password
|
||||
*
|
||||
* php Thelia admin:updatePassword
|
||||
*
|
||||
* Class AdminUpdatePasswordCommand
|
||||
* @package Thelia\Command
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class AdminUpdatePasswordCommand extends ContainerAwareCommand
|
||||
{
|
||||
|
||||
/**
|
||||
* Configures the current command.
|
||||
*/
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('admin:updatePassword')
|
||||
->setDescription('change administrator password')
|
||||
->setHelp('The <info>admin:updatePassword</info> command allows you to change the password for a given administrator')
|
||||
->addArgument(
|
||||
'login',
|
||||
InputArgument::REQUIRED,
|
||||
'Login for administrator you want to change the password'
|
||||
)
|
||||
->addOption(
|
||||
'password',
|
||||
null,
|
||||
InputOption::VALUE_REQUIRED,
|
||||
'Desired password. If this option is omitted, a random password is generated and shown in this prompt after'
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$login = $input->getArgument('login');
|
||||
|
||||
|
||||
if (null === $admin = AdminQuery::create()->filterByLogin($login)->findOne()) {
|
||||
throw new \RuntimeException(sprintf('Admin with login %s does not exists', $login));
|
||||
}
|
||||
|
||||
|
||||
$password = $input->getOption('password') ?: Password::generateRandom();
|
||||
|
||||
$event = new AdministratorUpdatePasswordEvent($admin);
|
||||
$event->setPassword($password);
|
||||
|
||||
|
||||
$this->
|
||||
getContainer()
|
||||
->get('event_dispatcher')
|
||||
->dispatch(TheliaEvents::ADMINISTRATOR_UPDATEPASSWORD, $event);
|
||||
|
||||
$output->writeln(array(
|
||||
'',
|
||||
sprintf('<info>admin %s password updated</info>', $login),
|
||||
sprintf('<info>new password is : %s</info>', $password),
|
||||
''
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,13 +35,14 @@ abstract class BaseModuleGenerate extends ContainerAwareCommand
|
||||
protected $moduleDirectory;
|
||||
|
||||
protected $reservedKeyWords = array(
|
||||
"thelia"
|
||||
'thelia'
|
||||
);
|
||||
|
||||
protected $neededDirectories = array(
|
||||
"Config",
|
||||
"Model",
|
||||
"Loop"
|
||||
'Config',
|
||||
'Model',
|
||||
'Loop',
|
||||
'AdminModule'
|
||||
);
|
||||
|
||||
protected function verifyExistingModule()
|
||||
|
||||
@@ -38,9 +38,9 @@ class CreateAdminUser extends ContainerAwareCommand
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName("thelia:create-admin")
|
||||
->setDescription("Create a new adminsitration user")
|
||||
->setHelp("The <info>thelia:create-admin</info> command create a new administration user.")
|
||||
->setName("admin:create")
|
||||
->setDescription("Create a new administrator user")
|
||||
->setHelp("The <info>admin:create</info> command create a new administration user.")
|
||||
->addOption(
|
||||
'login_name',
|
||||
null,
|
||||
|
||||
@@ -184,6 +184,7 @@
|
||||
<command class="Thelia\Command\CreateAdminUser"/>
|
||||
<command class="Thelia\Command\ReloadDatabaseCommand"/>
|
||||
<command class="Thelia\Command\GenerateResources"/>
|
||||
<command class="Thelia\Command\AdminUpdatePasswordCommand"/>
|
||||
</commands>
|
||||
|
||||
<services>
|
||||
|
||||
@@ -832,6 +832,18 @@
|
||||
|
||||
<!-- end mailing-system management -->
|
||||
|
||||
<!-- admin logs display -->
|
||||
|
||||
<route id="admin.configuration.admin-logs.view" path="/admin/configuration/adminLogs">
|
||||
<default key="_controller">Thelia\Controller\Admin\AdminLogsController::defaultAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.configuration.admin-logs.logger" path="/admin/configuration/adminLogs/logger">
|
||||
<default key="_controller">Thelia\Controller\Admin\AdminLogsController::loadLoggerAjaxAction</default>
|
||||
</route>
|
||||
|
||||
<!-- end admin logs display -->
|
||||
|
||||
<!-- feature and features value management -->
|
||||
|
||||
<route id="admin.configuration.features.default" path="/admin/configuration/features">
|
||||
|
||||
@@ -303,7 +303,7 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
|
||||
if (null !== $createdObject = $this->getObjectFromEvent($createEvent)) {
|
||||
// Log object creation
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) created", ucfirst($this->objectName), $this->getObjectLabel($createdObject), $this->getObjectId($createdObject)));
|
||||
$this->adminLogAppend($this->resourceCode, AccessManager::CREATE, sprintf("%s %s (ID %s) created", ucfirst($this->objectName), $this->getObjectLabel($createdObject), $this->getObjectId($createdObject)));
|
||||
}
|
||||
|
||||
$response = $this->performAdditionalCreateAction($createEvent);
|
||||
@@ -391,7 +391,7 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
|
||||
// Log object modification
|
||||
if (null !== $changedObject = $this->getObjectFromEvent($changeEvent)) {
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
$this->adminLogAppend($this->resourceCode, AccessManager::UPDATE, sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
}
|
||||
|
||||
$response = $this->performAdditionalUpdateAction($changeEvent);
|
||||
@@ -530,7 +530,8 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
|
||||
if (null !== $deletedObject = $this->getObjectFromEvent($deleteEvent)) {
|
||||
$this->adminLogAppend(
|
||||
sprintf("%s %s (ID %s) deleted", ucfirst($this->objectName), $this->getObjectLabel($deletedObject), $this->getObjectId($deletedObject)));
|
||||
$this->resourceCode, AccessManager::DELETE,
|
||||
sprintf("%s %s (ID %s) deleted", ucfirst($this->objectName), $this->getObjectLabel($deletedObject), $this->getObjectId($deletedObject)));
|
||||
}
|
||||
|
||||
$response = $this->performAdditionalDeleteAction($deleteEvent);
|
||||
|
||||
@@ -74,9 +74,9 @@ class AddressController extends AbstractCrudController
|
||||
|
||||
$this->dispatch(TheliaEvents::ADDRESS_DEFAULT, $addressEvent);
|
||||
|
||||
$this->adminLogAppend(sprintf("address %d for customer %d removal", $address_id, $address->getCustomerId()));
|
||||
$this->adminLogAppend($this->resourceCode, AccessManager::UPDATE, sprintf("address %d for customer %d set as default address", $address_id, $address->getCustomerId()));
|
||||
} catch (\Exception $e) {
|
||||
\Thelia\Log\Tlog::getInstance()->error(sprintf("error during address removal with message %s", $e->getMessage()));
|
||||
\Thelia\Log\Tlog::getInstance()->error(sprintf("error during address setting as default with message %s", $e->getMessage()));
|
||||
}
|
||||
|
||||
$this->redirectToRoute('admin.customer.update.view', array(), array('customer_id' => $address->getCustomerId()));
|
||||
|
||||
72
core/lib/Thelia/Controller/Admin/AdminLogsController.php
Normal file
72
core/lib/Thelia/Controller/Admin/AdminLogsController.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?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\Admin;
|
||||
|
||||
use Thelia\Core\Security\AccessManager;
|
||||
use Thelia\Model\AdminLogQuery;
|
||||
|
||||
class AdminLogsController extends BaseAdminController
|
||||
{
|
||||
const RESOURCE_CODE = "admin.admin-logs";
|
||||
|
||||
public function defaultAction()
|
||||
{
|
||||
if (null !== $response = $this->checkAuth(self::RESOURCE_CODE, AccessManager::VIEW)) return $response;
|
||||
|
||||
// Render the edition template.
|
||||
return $this->render('admin-logs');
|
||||
}
|
||||
|
||||
public function loadLoggerAjaxAction()
|
||||
{
|
||||
$entries = array();
|
||||
|
||||
foreach( AdminLogQuery::getEntries(
|
||||
$this->getRequest()->request->get('admins', array()),
|
||||
$this->getRequest()->request->get('fromDate', null),
|
||||
$this->getRequest()->request->get('toDate', null),
|
||||
array_merge($this->getRequest()->request->get('resources', array()), $this->getRequest()->request->get('modules', array())),
|
||||
null
|
||||
) as $entry) {
|
||||
|
||||
$entries[] = array(
|
||||
"head" => sprintf(
|
||||
"[%s][%s][%s:%s]",
|
||||
date('Y-m-d H:i:s', $entry->getCreatedAt()->getTimestamp()),
|
||||
$entry->getAdminLogin(),
|
||||
$entry->getResource(),
|
||||
$entry->getAction()
|
||||
),
|
||||
"data" => $entry->getMessage(),
|
||||
);
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'ajax/logger',
|
||||
array(
|
||||
'entries' => $entries,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,7 @@ class AreaController extends AbstractCrudController
|
||||
|
||||
// Log object modification
|
||||
if (null !== $changedObject = $this->getObjectFromEvent($event)) {
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) modified, new country added", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
$this->adminLogAppend($this->resourceCode, AccessManager::UPDATE, sprintf("%s %s (ID %s) modified, new country added", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
}
|
||||
|
||||
// Redirect to the success URL
|
||||
@@ -303,7 +303,7 @@ class AreaController extends AbstractCrudController
|
||||
|
||||
// Log object modification
|
||||
if (null !== $changedObject = $this->getObjectFromEvent($event)) {
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) modified, country remove", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
$this->adminLogAppend($this->resourceCode, AccessManager::UPDATE, sprintf("%s %s (ID %s) modified, country remove", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
}
|
||||
|
||||
// Redirect to the success URL
|
||||
|
||||
@@ -51,18 +51,20 @@ class BaseAdminController extends BaseController
|
||||
/**
|
||||
* Helper to append a message to the admin log.
|
||||
*
|
||||
* @param string $resource
|
||||
* @param string $action
|
||||
* @param string $message
|
||||
*/
|
||||
public function adminLogAppend($message)
|
||||
public function adminLogAppend($resource, $action, $message)
|
||||
{
|
||||
AdminLog::append($message, $this->getRequest(), $this->getSecurityContext()->getAdminUser());
|
||||
AdminLog::append($resource, $action, $message, $this->getRequest(), $this->getSecurityContext()->getAdminUser());
|
||||
}
|
||||
|
||||
/**
|
||||
* This method process the rendering of view called from an admin page
|
||||
*
|
||||
* @param unknown $template
|
||||
* @return Response the reponse which contains the rendered view
|
||||
* @return Response the response which contains the rendered view
|
||||
*/
|
||||
public function processTemplateAction($template)
|
||||
{
|
||||
@@ -131,7 +133,7 @@ class BaseAdminController extends BaseController
|
||||
}
|
||||
|
||||
// Log the problem
|
||||
$this->adminLogAppend("User is not granted for resources %s with accesses %s", implode(", ", $resources), implode(", ", $accesses));
|
||||
$this->adminLogAppend(implode(",", $resources), implode(",", $accesses), "User is not granted for resources %s with accesses %s", implode(", ", $resources), implode(", ", $accesses));
|
||||
|
||||
// Generate the proper response
|
||||
$response = new Response();
|
||||
|
||||
@@ -356,6 +356,7 @@ class CouponController extends BaseAdminController
|
||||
);
|
||||
|
||||
$this->adminLogAppend(
|
||||
AdminResources::COUPON, AccessManager::UPDATE,
|
||||
sprintf(
|
||||
'Coupon %s (ID %s) conditions updated',
|
||||
$couponEvent->getCouponModel()->getTitle(),
|
||||
@@ -468,6 +469,7 @@ class CouponController extends BaseAdminController
|
||||
);
|
||||
|
||||
$this->adminLogAppend(
|
||||
AdminResources::COUPON, AccessManager::UPDATE,
|
||||
sprintf(
|
||||
'Coupon %s (ID ) ' . $log,
|
||||
$couponEvent->getTitle(),
|
||||
|
||||
@@ -87,7 +87,7 @@ class CustomerController extends BaseAdminController
|
||||
|
||||
$customerUpdated = $event->getCustomer();
|
||||
|
||||
$this->adminLogAppend(sprintf("Customer with Ref %s (ID %d) modified", $customerUpdated->getRef() , $customerUpdated->getId()));
|
||||
$this->adminLogAppend(AdminResources::CUSTOMER, AccessManager::UPDATE, sprintf("Customer with Ref %s (ID %d) modified", $customerUpdated->getRef() , $customerUpdated->getId()));
|
||||
|
||||
if ($this->getRequest()->get("save_mode") == "close") {
|
||||
$this->redirectToRoute("admin.customers");
|
||||
|
||||
@@ -130,6 +130,20 @@ class FileController extends BaseAdminController
|
||||
$imageCreateOrUpdateEvent
|
||||
);
|
||||
|
||||
$this->adminLogAppend(
|
||||
AdminResources::retrieve($parentType),
|
||||
AccessManager::UPDATE,
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Saving images for %parentName% parent id %parentId% (%parentType%)',
|
||||
array(
|
||||
'%parentName%' => $event->getParentName(),
|
||||
'%parentId%' => $event->getParentId(),
|
||||
'%parentType%' => $event->getImageType()
|
||||
),
|
||||
'image'
|
||||
)
|
||||
);
|
||||
|
||||
return new ResponseRest(array('status' => true, 'message' => ''));
|
||||
}
|
||||
}
|
||||
@@ -194,6 +208,20 @@ class FileController extends BaseAdminController
|
||||
$documentCreateOrUpdateEvent
|
||||
);
|
||||
|
||||
$this->adminLogAppend(
|
||||
AdminResources::retrieve($parentType),
|
||||
AccessManager::UPDATE,
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Saving documents for %parentName% parent id %parentId% (%parentType%)',
|
||||
array(
|
||||
'%parentName%' => $event->getParentName(),
|
||||
'%parentId%' => $event->getParentId(),
|
||||
'%parentType%' => $event->getDocumentType()
|
||||
),
|
||||
'document'
|
||||
)
|
||||
);
|
||||
|
||||
return new ResponseRest(array('status' => true, 'message' => ''));
|
||||
}
|
||||
}
|
||||
@@ -368,7 +396,7 @@ class FileController extends BaseAdminController
|
||||
|
||||
$imageUpdated = $event->getModelImage();
|
||||
|
||||
$this->adminLogAppend(sprintf('Image with Ref %s (ID %d) modified', $imageUpdated->getTitle(), $imageUpdated->getId()));
|
||||
$this->adminLogAppend(AdminResources::retrieve($parentType), AccessManager::UPDATE, sprintf('Image with Ref %s (ID %d) modified', $imageUpdated->getTitle(), $imageUpdated->getId()));
|
||||
|
||||
if ($this->getRequest()->get('save_mode') == 'close') {
|
||||
$this->redirectToRoute('admin.images');
|
||||
@@ -445,7 +473,7 @@ class FileController extends BaseAdminController
|
||||
|
||||
$documentUpdated = $event->getModelDocument();
|
||||
|
||||
$this->adminLogAppend(sprintf('Document with Ref %s (ID %d) modified', $documentUpdated->getTitle(), $documentUpdated->getId()));
|
||||
$this->adminLogAppend(AdminResources::retrieve($parentType), AccessManager::UPDATE, sprintf('Document with Ref %s (ID %d) modified', $documentUpdated->getTitle(), $documentUpdated->getId()));
|
||||
|
||||
if ($this->getRequest()->get('save_mode') == 'close') {
|
||||
$this->redirectToRoute('admin.documents');
|
||||
@@ -509,10 +537,39 @@ class FileController extends BaseAdminController
|
||||
);
|
||||
|
||||
// Dispatch Event to the Action
|
||||
$this->dispatch(
|
||||
TheliaEvents::IMAGE_DELETE,
|
||||
$imageDeleteEvent
|
||||
);
|
||||
try {
|
||||
$this->dispatch(
|
||||
TheliaEvents::IMAGE_DELETE,
|
||||
$imageDeleteEvent
|
||||
);
|
||||
|
||||
$this->adminLogAppend(
|
||||
AdminResources::retrieve($parentType),
|
||||
AccessManager::UPDATE,
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Deleting image for %id% with parent id %parentId%',
|
||||
array(
|
||||
'%id%' => $event->getDocumentToDelete()->getId(),
|
||||
'%parentId%' => $event->getDocumentToDelete()->getParentId(),
|
||||
),
|
||||
'image'
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
$this->adminLogAppend(
|
||||
AdminResources::retrieve($parentType),
|
||||
AccessManager::UPDATE,
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Fail to delete image for %id% with parent id %parentId% (Exception : %e%)',
|
||||
array(
|
||||
'%id%' => $event->getDocumentToDelete()->getId(),
|
||||
'%parentId%' => $event->getDocumentToDelete()->getParentId(),
|
||||
'%e%' => $e->getMessage()
|
||||
),
|
||||
'image'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$message = $this->getTranslator()
|
||||
->trans(
|
||||
@@ -552,10 +609,39 @@ class FileController extends BaseAdminController
|
||||
);
|
||||
|
||||
// Dispatch Event to the Action
|
||||
$this->dispatch(
|
||||
TheliaEvents::DOCUMENT_DELETE,
|
||||
$documentDeleteEvent
|
||||
);
|
||||
try {
|
||||
$this->dispatch(
|
||||
TheliaEvents::DOCUMENT_DELETE,
|
||||
$documentDeleteEvent
|
||||
);
|
||||
|
||||
$this->adminLogAppend(
|
||||
AdminResources::retrieve($parentType),
|
||||
AccessManager::UPDATE,
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Deleting document for %id% with parent id %parentId%',
|
||||
array(
|
||||
'%id%' => $event->getDocumentToDelete()->getId(),
|
||||
'%parentId%' => $event->getDocumentToDelete()->getParentId(),
|
||||
),
|
||||
'document'
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
$this->adminLogAppend(
|
||||
AdminResources::retrieve($parentType),
|
||||
AccessManager::UPDATE,
|
||||
$this->container->get('thelia.translator')->trans(
|
||||
'Fail to delete document for %id% with parent id %parentId% (Exception : %e%)',
|
||||
array(
|
||||
'%id%' => $event->getDocumentToDelete()->getId(),
|
||||
'%parentId%' => $event->getDocumentToDelete()->getParentId(),
|
||||
'%e%' => $e->getMessage()
|
||||
),
|
||||
'document'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$message = $this->getTranslator()
|
||||
->trans(
|
||||
|
||||
@@ -116,7 +116,7 @@ class LangController extends BaseAdminController
|
||||
}
|
||||
|
||||
$changedObject = $event->getLang();
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) modified", 'Lang', $changedObject->getTitle(), $changedObject->getId()));
|
||||
$this->adminLogAppend(AdminResources::LANGUAGE, AccessManager::UPDATE, sprintf("%s %s (ID %s) modified", 'Lang', $changedObject->getTitle(), $changedObject->getId()));
|
||||
$this->redirectToRoute('/admin/configuration/languages');
|
||||
} catch (\Exception $e) {
|
||||
$error_msg = $e->getMessage();
|
||||
@@ -153,7 +153,7 @@ class LangController extends BaseAdminController
|
||||
}
|
||||
|
||||
$changedObject = $event->getLang();
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) modified", 'Lang', $changedObject->getTitle(), $changedObject->getId()));
|
||||
$this->adminLogAppend(AdminResources::LANGUAGE, AccessManager::UPDATE, sprintf("%s %s (ID %s) modified", 'Lang', $changedObject->getTitle(), $changedObject->getId()));
|
||||
|
||||
} catch (\Exception $e) {
|
||||
\Thelia\Log\Tlog::getInstance()->error(sprintf("Error on changing default languages with message : %s", $e->getMessage()));
|
||||
@@ -189,7 +189,7 @@ class LangController extends BaseAdminController
|
||||
}
|
||||
|
||||
$createdObject = $createEvent->getLang();
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) created", 'Lang', $createdObject->getTitle(), $createdObject->getId()));
|
||||
$this->adminLogAppend(AdminResources::LANGUAGE, AccessManager::CREATE, sprintf("%s %s (ID %s) created", 'Lang', $createdObject->getTitle(), $createdObject->getId()));
|
||||
|
||||
$this->redirectToRoute('admin.configuration.languages');
|
||||
|
||||
|
||||
@@ -933,7 +933,7 @@ class ProductController extends AbstractCrudController
|
||||
|
||||
// Log object modification
|
||||
if (null !== $changedObject = $event->getProductSaleElement()) {
|
||||
$this->adminLogAppend(sprintf("Product Sale Element (ID %s) for product reference %s modified", $changedObject->getId(), $event->getProduct()->getRef()));
|
||||
$this->adminLogAppend($this->resourceCode, AccessManager::UPDATE, sprintf("Product Sale Element (ID %s) for product reference %s modified", $changedObject->getId(), $event->getProduct()->getRef()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ class ProfileController extends AbstractCrudController
|
||||
|
||||
// Log object modification
|
||||
if (null !== $changedObject = $this->getObjectFromEvent($changeEvent)) {
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
$this->adminLogAppend($this->resourceCode, AccessManager::UPDATE, sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
}
|
||||
|
||||
if ($response == null) {
|
||||
@@ -379,7 +379,7 @@ class ProfileController extends AbstractCrudController
|
||||
|
||||
// Log object modification
|
||||
if (null !== $changedObject = $this->getObjectFromEvent($changeEvent)) {
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
$this->adminLogAppend($this->resourceCode, AccessManager::UPDATE, sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
}
|
||||
|
||||
if ($response == null) {
|
||||
|
||||
@@ -50,7 +50,7 @@ class SessionController extends BaseAdminController
|
||||
|
||||
$this->getSecurityContext()->setAdminUser($user);
|
||||
|
||||
$this->adminLogAppend("Successful token authentication");
|
||||
$this->adminLogAppend("admin", "LOGIN", "Successful token authentication");
|
||||
|
||||
// Update the cookie
|
||||
$cookie = $this->createAdminRememberMeCookie($user);
|
||||
@@ -58,7 +58,7 @@ class SessionController extends BaseAdminController
|
||||
// Render the home page
|
||||
return $this->render("home");
|
||||
} catch (TokenAuthenticationException $ex) {
|
||||
$this->adminLogAppend("Token based authentication failed.");
|
||||
$this->adminLogAppend("admin", "LOGIN", "Token based authentication failed.");
|
||||
|
||||
// Clear the cookie
|
||||
$this->clearRememberMeCookie();
|
||||
@@ -99,7 +99,7 @@ class SessionController extends BaseAdminController
|
||||
$this->getSecurityContext()->setAdminUser($user);
|
||||
|
||||
// Log authentication success
|
||||
AdminLog::append("Authentication successful", $request, $user);
|
||||
AdminLog::append("admin", "LOGIN", "Authentication successful", $request, $user);
|
||||
|
||||
/**
|
||||
* FIXME: we have tou find a way to send cookie
|
||||
@@ -122,13 +122,13 @@ class SessionController extends BaseAdminController
|
||||
} catch (AuthenticationException $ex) {
|
||||
|
||||
// Log authentication failure
|
||||
AdminLog::append(sprintf("Authentication failure for username '%s'", $authenticator->getUsername()), $request);
|
||||
AdminLog::append("admin", "LOGIN", sprintf("Authentication failure for username '%s'", $authenticator->getUsername()), $request);
|
||||
|
||||
$message = $this->getTranslator()->trans("Login failed. Please check your username and password.");
|
||||
} catch (\Exception $ex) {
|
||||
|
||||
// Log authentication failure
|
||||
AdminLog::append(sprintf("Undefined error: %s", $ex->getMessage()), $request);
|
||||
AdminLog::append("admin", "LOGIN", sprintf("Undefined error: %s", $ex->getMessage()), $request);
|
||||
|
||||
$message = $this->getTranslator()->trans(
|
||||
"Unable to process your request. Please try again (%err).",
|
||||
|
||||
@@ -279,7 +279,7 @@ class TaxRuleController extends AbstractCrudController
|
||||
|
||||
// Log object modification
|
||||
if (null !== $changedObject = $this->getObjectFromEvent($changeEvent)) {
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
$this->adminLogAppend($this->resourceCode, AccessManager::UPDATE, sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
}
|
||||
|
||||
if ($response == null) {
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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\Administrator;
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
use Thelia\Model\Admin;
|
||||
|
||||
|
||||
/**
|
||||
* Class AdministratorUpdatePasswordEvent
|
||||
* @package Thelia\Core\Event\Administrator
|
||||
* @author Manuel Raynaud <mraynaud@openstudio.fr>
|
||||
*/
|
||||
class AdministratorUpdatePasswordEvent extends ActionEvent
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \Thelia\Model\Admin
|
||||
*/
|
||||
protected $admin;
|
||||
|
||||
/**
|
||||
* @var string new administrator password
|
||||
*/
|
||||
protected $password;
|
||||
|
||||
public function __construct(Admin $admin)
|
||||
{
|
||||
$this->admin = $admin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $password
|
||||
*/
|
||||
public function setPassword($password)
|
||||
{
|
||||
$this->password = $password;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Thelia\Model\Admin $admin
|
||||
*/
|
||||
public function setAdmin(Admin $admin)
|
||||
{
|
||||
$this->admin = $admin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Thelia\Model\Admin
|
||||
*/
|
||||
public function getAdmin()
|
||||
{
|
||||
return $this->admin;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -567,6 +567,7 @@ final class TheliaEvents
|
||||
const ADMINISTRATOR_CREATE = "action.createAdministrator";
|
||||
const ADMINISTRATOR_UPDATE = "action.updateAdministrator";
|
||||
const ADMINISTRATOR_DELETE = "action.deleteAdministrator";
|
||||
const ADMINISTRATOR_UPDATEPASSWORD = 'action.generatePassword';
|
||||
|
||||
// -- Mailing System management ---------------------------------------------
|
||||
|
||||
|
||||
@@ -43,7 +43,17 @@ class Assetic extends AbstractSmartyPlugin
|
||||
|
||||
public function blockJavascripts($params, $content, \Smarty_Internal_Template $template, &$repeat)
|
||||
{
|
||||
return $this->assetManager->processSmartyPluginCall('js', $params, $content, $template, $repeat);
|
||||
try {
|
||||
return $this->assetManager->processSmartyPluginCall('js', $params, $content, $template, $repeat);
|
||||
} catch(\Exception $e) {
|
||||
$catchException = $this->getNormalizedParam($params, array('catchException'));
|
||||
if($catchException == "true") {
|
||||
$repeat = false;
|
||||
return null;
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function blockImages($params, $content, \Smarty_Internal_Template $template, &$repeat)
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Thelia\Core\Template\Smarty\Plugins;
|
||||
|
||||
use Thelia\Core\Template\Smarty\SmartyPluginDescriptor;
|
||||
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
|
||||
use Thelia\Model\ModuleQuery;
|
||||
|
||||
class Module extends AbstractSmartyPlugin
|
||||
{
|
||||
@@ -32,13 +33,27 @@ class Module extends AbstractSmartyPlugin
|
||||
* Process theliaModule template inclusion function
|
||||
*
|
||||
* @param unknown $params
|
||||
* @param unknown $smarty
|
||||
* @param \Smarty_Internal_Template $template
|
||||
* @internal param \Thelia\Core\Template\Smarty\Plugins\unknown $smarty
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function theliaModule($params, &$smarty)
|
||||
public function theliaModule($params, \Smarty_Internal_Template $template)
|
||||
{
|
||||
// TODO
|
||||
return "";
|
||||
$content = null;
|
||||
if (array_key_exists('location', $params)) {
|
||||
$location = $params['location'];
|
||||
$modules = ModuleQuery::getActivated();
|
||||
|
||||
foreach ($modules as $module) {
|
||||
|
||||
$file = THELIA_MODULE_DIR . "/". ucfirst($module->getCode()) . "/ModuleAdmin/".$location.".html";
|
||||
if(file_exists($file)) {
|
||||
$content .= file_get_contents($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $template->fetch(sprintf("string:%s", $content));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -70,8 +70,14 @@ class SmartyParser extends Smarty implements ParserInterface
|
||||
$this->error_reporting = E_ALL ^ E_NOTICE;
|
||||
|
||||
// Si on n'est pas en mode debug, activer le cache, avec une lifetime de 15mn, et en vérifiant que les templates sources n'ont pas été modifiés.
|
||||
$this->caching = Smarty::CACHING_OFF;
|
||||
$this->force_compile = true;
|
||||
|
||||
if($debug) {
|
||||
$this->setCaching(Smarty::CACHING_OFF);
|
||||
$this->setForceCompile(true);
|
||||
} else {
|
||||
$this->setForceCompile(false);
|
||||
}
|
||||
|
||||
|
||||
// The default HTTP status
|
||||
$this->status = 200;
|
||||
|
||||
@@ -7,16 +7,18 @@ use Thelia\Core\HttpFoundation\Request;
|
||||
use Thelia\Log\Tlog;
|
||||
use Thelia\Model\Base\Admin as BaseAdminUser;
|
||||
|
||||
class AdminLog extends BaseAdminLog {
|
||||
|
||||
/**
|
||||
* A sdimple helper to insert an entry in the admin log
|
||||
class AdminLog extends BaseAdminLog
|
||||
{
|
||||
/**
|
||||
* A simple helper to insert an entry in the admin log
|
||||
*
|
||||
* @param unknown $actionLabel
|
||||
* @param Request $request
|
||||
* @param Admin $adminUser
|
||||
*/
|
||||
public static function append($actionLabel, Request $request, BaseAdminUser $adminUser = null) {
|
||||
* @param $resource
|
||||
* @param $action
|
||||
* @param $message
|
||||
* @param Request $request
|
||||
* @param Base\Admin $adminUser
|
||||
*/
|
||||
public static function append($resource, $action, $message, Request $request, BaseAdminUser $adminUser = null) {
|
||||
|
||||
$log = new AdminLog();
|
||||
|
||||
@@ -24,7 +26,9 @@ class AdminLog extends BaseAdminLog {
|
||||
->setAdminLogin($adminUser !== null ? $adminUser->getLogin() : '<no login>')
|
||||
->setAdminFirstname($adminUser !== null ? $adminUser->getFirstname() : '<no first name>')
|
||||
->setAdminLastname($adminUser !== null ? $adminUser->getLastname() : '<no last name>')
|
||||
->setAction($actionLabel)
|
||||
->setResource($resource)
|
||||
->setAction($action)
|
||||
->setMessage($message)
|
||||
->setRequest($request->__toString())
|
||||
;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Thelia\Model\Base\AdminLogQuery as BaseAdminLogQuery;
|
||||
|
||||
|
||||
@@ -15,6 +16,43 @@ use Thelia\Model\Base\AdminLogQuery as BaseAdminLogQuery;
|
||||
* long as it does not already exist in the output directory.
|
||||
*
|
||||
*/
|
||||
class AdminLogQuery extends BaseAdminLogQuery {
|
||||
class AdminLogQuery extends BaseAdminLogQuery
|
||||
{
|
||||
/**
|
||||
* @param null $login
|
||||
* @param null $minDate
|
||||
* @param null $maxDate
|
||||
* @param null $resources
|
||||
* @param null $actions
|
||||
*
|
||||
* @return array|mixed|\Propel\Runtime\Collection\ObjectCollection
|
||||
*/
|
||||
public static function getEntries($login = null, $minDate = null, $maxDate = null, $resources = null, $actions = null)
|
||||
{
|
||||
$search = self::create();
|
||||
|
||||
if(null !== $minDate) {
|
||||
$search->filterByCreatedAt($minDate, Criteria::GREATER_EQUAL);
|
||||
}
|
||||
|
||||
if(null !== $maxDate) {
|
||||
$maxDateObject = new \DateTime($maxDate);
|
||||
$maxDateObject->add(new \DateInterval('P1D'));
|
||||
$search->filterByCreatedAt(date('Y-m-d', $maxDateObject->getTimestamp()), Criteria::LESS_THAN);
|
||||
}
|
||||
|
||||
if(null !== $resources) {
|
||||
$search->filterByResource($resources);
|
||||
}
|
||||
|
||||
if(null !== $actions) {
|
||||
$search->filterByAction($actions);
|
||||
}
|
||||
|
||||
if(null !== $login) {
|
||||
$search->filterByAdminLogin($login);
|
||||
}
|
||||
|
||||
return $search->find();
|
||||
}
|
||||
} // AdminLogQuery
|
||||
|
||||
@@ -78,12 +78,24 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
*/
|
||||
protected $admin_lastname;
|
||||
|
||||
/**
|
||||
* The value for the resource field.
|
||||
* @var string
|
||||
*/
|
||||
protected $resource;
|
||||
|
||||
/**
|
||||
* The value for the action field.
|
||||
* @var string
|
||||
*/
|
||||
protected $action;
|
||||
|
||||
/**
|
||||
* The value for the message field.
|
||||
* @var string
|
||||
*/
|
||||
protected $message;
|
||||
|
||||
/**
|
||||
* The value for the request field.
|
||||
* @var string
|
||||
@@ -412,6 +424,17 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
return $this->admin_lastname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [resource] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getResource()
|
||||
{
|
||||
|
||||
return $this->resource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [action] column value.
|
||||
*
|
||||
@@ -423,6 +446,17 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [message] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [request] column value.
|
||||
*
|
||||
@@ -558,6 +592,27 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setAdminLastname()
|
||||
|
||||
/**
|
||||
* Set the value of [resource] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\AdminLog The current object (for fluent API support)
|
||||
*/
|
||||
public function setResource($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->resource !== $v) {
|
||||
$this->resource = $v;
|
||||
$this->modifiedColumns[] = AdminLogTableMap::RESOURCE;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setResource()
|
||||
|
||||
/**
|
||||
* Set the value of [action] column.
|
||||
*
|
||||
@@ -579,6 +634,27 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
return $this;
|
||||
} // setAction()
|
||||
|
||||
/**
|
||||
* Set the value of [message] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return \Thelia\Model\AdminLog The current object (for fluent API support)
|
||||
*/
|
||||
public function setMessage($v)
|
||||
{
|
||||
if ($v !== null) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->message !== $v) {
|
||||
$this->message = $v;
|
||||
$this->modifiedColumns[] = AdminLogTableMap::MESSAGE;
|
||||
}
|
||||
|
||||
|
||||
return $this;
|
||||
} // setMessage()
|
||||
|
||||
/**
|
||||
* Set the value of [request] column.
|
||||
*
|
||||
@@ -691,19 +767,25 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : AdminLogTableMap::translateFieldName('AdminLastname', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->admin_lastname = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AdminLogTableMap::translateFieldName('Action', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : AdminLogTableMap::translateFieldName('Resource', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->resource = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : AdminLogTableMap::translateFieldName('Action', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->action = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : AdminLogTableMap::translateFieldName('Request', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : AdminLogTableMap::translateFieldName('Message', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->message = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : AdminLogTableMap::translateFieldName('Request', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$this->request = (null !== $col) ? (string) $col : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 6 + $startcol : AdminLogTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 8 + $startcol : AdminLogTableMap::translateFieldName('CreatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
$this->created_at = (null !== $col) ? PropelDateTime::newInstance($col, null, '\DateTime') : null;
|
||||
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 7 + $startcol : AdminLogTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
$col = $row[TableMap::TYPE_NUM == $indexType ? 9 + $startcol : AdminLogTableMap::translateFieldName('UpdatedAt', TableMap::TYPE_PHPNAME, $indexType)];
|
||||
if ($col === '0000-00-00 00:00:00') {
|
||||
$col = null;
|
||||
}
|
||||
@@ -716,7 +798,7 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
$this->ensureConsistency();
|
||||
}
|
||||
|
||||
return $startcol + 8; // 8 = AdminLogTableMap::NUM_HYDRATE_COLUMNS.
|
||||
return $startcol + 10; // 10 = AdminLogTableMap::NUM_HYDRATE_COLUMNS.
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating \Thelia\Model\AdminLog object", 0, $e);
|
||||
@@ -948,9 +1030,15 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(AdminLogTableMap::ADMIN_LASTNAME)) {
|
||||
$modifiedColumns[':p' . $index++] = 'ADMIN_LASTNAME';
|
||||
}
|
||||
if ($this->isColumnModified(AdminLogTableMap::RESOURCE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'RESOURCE';
|
||||
}
|
||||
if ($this->isColumnModified(AdminLogTableMap::ACTION)) {
|
||||
$modifiedColumns[':p' . $index++] = 'ACTION';
|
||||
}
|
||||
if ($this->isColumnModified(AdminLogTableMap::MESSAGE)) {
|
||||
$modifiedColumns[':p' . $index++] = 'MESSAGE';
|
||||
}
|
||||
if ($this->isColumnModified(AdminLogTableMap::REQUEST)) {
|
||||
$modifiedColumns[':p' . $index++] = 'REQUEST';
|
||||
}
|
||||
@@ -983,9 +1071,15 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
case 'ADMIN_LASTNAME':
|
||||
$stmt->bindValue($identifier, $this->admin_lastname, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'RESOURCE':
|
||||
$stmt->bindValue($identifier, $this->resource, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'ACTION':
|
||||
$stmt->bindValue($identifier, $this->action, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'MESSAGE':
|
||||
$stmt->bindValue($identifier, $this->message, PDO::PARAM_STR);
|
||||
break;
|
||||
case 'REQUEST':
|
||||
$stmt->bindValue($identifier, $this->request, PDO::PARAM_STR);
|
||||
break;
|
||||
@@ -1070,15 +1164,21 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
return $this->getAdminLastname();
|
||||
break;
|
||||
case 4:
|
||||
return $this->getAction();
|
||||
return $this->getResource();
|
||||
break;
|
||||
case 5:
|
||||
return $this->getRequest();
|
||||
return $this->getAction();
|
||||
break;
|
||||
case 6:
|
||||
return $this->getCreatedAt();
|
||||
return $this->getMessage();
|
||||
break;
|
||||
case 7:
|
||||
return $this->getRequest();
|
||||
break;
|
||||
case 8:
|
||||
return $this->getCreatedAt();
|
||||
break;
|
||||
case 9:
|
||||
return $this->getUpdatedAt();
|
||||
break;
|
||||
default:
|
||||
@@ -1113,10 +1213,12 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
$keys[1] => $this->getAdminLogin(),
|
||||
$keys[2] => $this->getAdminFirstname(),
|
||||
$keys[3] => $this->getAdminLastname(),
|
||||
$keys[4] => $this->getAction(),
|
||||
$keys[5] => $this->getRequest(),
|
||||
$keys[6] => $this->getCreatedAt(),
|
||||
$keys[7] => $this->getUpdatedAt(),
|
||||
$keys[4] => $this->getResource(),
|
||||
$keys[5] => $this->getAction(),
|
||||
$keys[6] => $this->getMessage(),
|
||||
$keys[7] => $this->getRequest(),
|
||||
$keys[8] => $this->getCreatedAt(),
|
||||
$keys[9] => $this->getUpdatedAt(),
|
||||
);
|
||||
$virtualColumns = $this->virtualColumns;
|
||||
foreach ($virtualColumns as $key => $virtualColumn) {
|
||||
@@ -1169,15 +1271,21 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
$this->setAdminLastname($value);
|
||||
break;
|
||||
case 4:
|
||||
$this->setAction($value);
|
||||
$this->setResource($value);
|
||||
break;
|
||||
case 5:
|
||||
$this->setRequest($value);
|
||||
$this->setAction($value);
|
||||
break;
|
||||
case 6:
|
||||
$this->setCreatedAt($value);
|
||||
$this->setMessage($value);
|
||||
break;
|
||||
case 7:
|
||||
$this->setRequest($value);
|
||||
break;
|
||||
case 8:
|
||||
$this->setCreatedAt($value);
|
||||
break;
|
||||
case 9:
|
||||
$this->setUpdatedAt($value);
|
||||
break;
|
||||
} // switch()
|
||||
@@ -1208,10 +1316,12 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
if (array_key_exists($keys[1], $arr)) $this->setAdminLogin($arr[$keys[1]]);
|
||||
if (array_key_exists($keys[2], $arr)) $this->setAdminFirstname($arr[$keys[2]]);
|
||||
if (array_key_exists($keys[3], $arr)) $this->setAdminLastname($arr[$keys[3]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setAction($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setRequest($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setCreatedAt($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setUpdatedAt($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[4], $arr)) $this->setResource($arr[$keys[4]]);
|
||||
if (array_key_exists($keys[5], $arr)) $this->setAction($arr[$keys[5]]);
|
||||
if (array_key_exists($keys[6], $arr)) $this->setMessage($arr[$keys[6]]);
|
||||
if (array_key_exists($keys[7], $arr)) $this->setRequest($arr[$keys[7]]);
|
||||
if (array_key_exists($keys[8], $arr)) $this->setCreatedAt($arr[$keys[8]]);
|
||||
if (array_key_exists($keys[9], $arr)) $this->setUpdatedAt($arr[$keys[9]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1227,7 +1337,9 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
if ($this->isColumnModified(AdminLogTableMap::ADMIN_LOGIN)) $criteria->add(AdminLogTableMap::ADMIN_LOGIN, $this->admin_login);
|
||||
if ($this->isColumnModified(AdminLogTableMap::ADMIN_FIRSTNAME)) $criteria->add(AdminLogTableMap::ADMIN_FIRSTNAME, $this->admin_firstname);
|
||||
if ($this->isColumnModified(AdminLogTableMap::ADMIN_LASTNAME)) $criteria->add(AdminLogTableMap::ADMIN_LASTNAME, $this->admin_lastname);
|
||||
if ($this->isColumnModified(AdminLogTableMap::RESOURCE)) $criteria->add(AdminLogTableMap::RESOURCE, $this->resource);
|
||||
if ($this->isColumnModified(AdminLogTableMap::ACTION)) $criteria->add(AdminLogTableMap::ACTION, $this->action);
|
||||
if ($this->isColumnModified(AdminLogTableMap::MESSAGE)) $criteria->add(AdminLogTableMap::MESSAGE, $this->message);
|
||||
if ($this->isColumnModified(AdminLogTableMap::REQUEST)) $criteria->add(AdminLogTableMap::REQUEST, $this->request);
|
||||
if ($this->isColumnModified(AdminLogTableMap::CREATED_AT)) $criteria->add(AdminLogTableMap::CREATED_AT, $this->created_at);
|
||||
if ($this->isColumnModified(AdminLogTableMap::UPDATED_AT)) $criteria->add(AdminLogTableMap::UPDATED_AT, $this->updated_at);
|
||||
@@ -1297,7 +1409,9 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
$copyObj->setAdminLogin($this->getAdminLogin());
|
||||
$copyObj->setAdminFirstname($this->getAdminFirstname());
|
||||
$copyObj->setAdminLastname($this->getAdminLastname());
|
||||
$copyObj->setResource($this->getResource());
|
||||
$copyObj->setAction($this->getAction());
|
||||
$copyObj->setMessage($this->getMessage());
|
||||
$copyObj->setRequest($this->getRequest());
|
||||
$copyObj->setCreatedAt($this->getCreatedAt());
|
||||
$copyObj->setUpdatedAt($this->getUpdatedAt());
|
||||
@@ -1338,7 +1452,9 @@ abstract class AdminLog implements ActiveRecordInterface
|
||||
$this->admin_login = null;
|
||||
$this->admin_firstname = null;
|
||||
$this->admin_lastname = null;
|
||||
$this->resource = null;
|
||||
$this->action = null;
|
||||
$this->message = null;
|
||||
$this->request = null;
|
||||
$this->created_at = null;
|
||||
$this->updated_at = null;
|
||||
|
||||
@@ -22,7 +22,9 @@ use Thelia\Model\Map\AdminLogTableMap;
|
||||
* @method ChildAdminLogQuery orderByAdminLogin($order = Criteria::ASC) Order by the admin_login column
|
||||
* @method ChildAdminLogQuery orderByAdminFirstname($order = Criteria::ASC) Order by the admin_firstname column
|
||||
* @method ChildAdminLogQuery orderByAdminLastname($order = Criteria::ASC) Order by the admin_lastname column
|
||||
* @method ChildAdminLogQuery orderByResource($order = Criteria::ASC) Order by the resource column
|
||||
* @method ChildAdminLogQuery orderByAction($order = Criteria::ASC) Order by the action column
|
||||
* @method ChildAdminLogQuery orderByMessage($order = Criteria::ASC) Order by the message column
|
||||
* @method ChildAdminLogQuery orderByRequest($order = Criteria::ASC) Order by the request column
|
||||
* @method ChildAdminLogQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
|
||||
* @method ChildAdminLogQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
|
||||
@@ -31,7 +33,9 @@ use Thelia\Model\Map\AdminLogTableMap;
|
||||
* @method ChildAdminLogQuery groupByAdminLogin() Group by the admin_login column
|
||||
* @method ChildAdminLogQuery groupByAdminFirstname() Group by the admin_firstname column
|
||||
* @method ChildAdminLogQuery groupByAdminLastname() Group by the admin_lastname column
|
||||
* @method ChildAdminLogQuery groupByResource() Group by the resource column
|
||||
* @method ChildAdminLogQuery groupByAction() Group by the action column
|
||||
* @method ChildAdminLogQuery groupByMessage() Group by the message column
|
||||
* @method ChildAdminLogQuery groupByRequest() Group by the request column
|
||||
* @method ChildAdminLogQuery groupByCreatedAt() Group by the created_at column
|
||||
* @method ChildAdminLogQuery groupByUpdatedAt() Group by the updated_at column
|
||||
@@ -47,7 +51,9 @@ use Thelia\Model\Map\AdminLogTableMap;
|
||||
* @method ChildAdminLog findOneByAdminLogin(string $admin_login) Return the first ChildAdminLog filtered by the admin_login column
|
||||
* @method ChildAdminLog findOneByAdminFirstname(string $admin_firstname) Return the first ChildAdminLog filtered by the admin_firstname column
|
||||
* @method ChildAdminLog findOneByAdminLastname(string $admin_lastname) Return the first ChildAdminLog filtered by the admin_lastname column
|
||||
* @method ChildAdminLog findOneByResource(string $resource) Return the first ChildAdminLog filtered by the resource column
|
||||
* @method ChildAdminLog findOneByAction(string $action) Return the first ChildAdminLog filtered by the action column
|
||||
* @method ChildAdminLog findOneByMessage(string $message) Return the first ChildAdminLog filtered by the message column
|
||||
* @method ChildAdminLog findOneByRequest(string $request) Return the first ChildAdminLog filtered by the request column
|
||||
* @method ChildAdminLog findOneByCreatedAt(string $created_at) Return the first ChildAdminLog filtered by the created_at column
|
||||
* @method ChildAdminLog findOneByUpdatedAt(string $updated_at) Return the first ChildAdminLog filtered by the updated_at column
|
||||
@@ -56,7 +62,9 @@ use Thelia\Model\Map\AdminLogTableMap;
|
||||
* @method array findByAdminLogin(string $admin_login) Return ChildAdminLog objects filtered by the admin_login column
|
||||
* @method array findByAdminFirstname(string $admin_firstname) Return ChildAdminLog objects filtered by the admin_firstname column
|
||||
* @method array findByAdminLastname(string $admin_lastname) Return ChildAdminLog objects filtered by the admin_lastname column
|
||||
* @method array findByResource(string $resource) Return ChildAdminLog objects filtered by the resource column
|
||||
* @method array findByAction(string $action) Return ChildAdminLog objects filtered by the action column
|
||||
* @method array findByMessage(string $message) Return ChildAdminLog objects filtered by the message column
|
||||
* @method array findByRequest(string $request) Return ChildAdminLog objects filtered by the request column
|
||||
* @method array findByCreatedAt(string $created_at) Return ChildAdminLog objects filtered by the created_at column
|
||||
* @method array findByUpdatedAt(string $updated_at) Return ChildAdminLog objects filtered by the updated_at column
|
||||
@@ -148,7 +156,7 @@ abstract class AdminLogQuery extends ModelCriteria
|
||||
*/
|
||||
protected function findPkSimple($key, $con)
|
||||
{
|
||||
$sql = 'SELECT ID, ADMIN_LOGIN, ADMIN_FIRSTNAME, ADMIN_LASTNAME, ACTION, REQUEST, CREATED_AT, UPDATED_AT FROM admin_log WHERE ID = :p0';
|
||||
$sql = 'SELECT ID, ADMIN_LOGIN, ADMIN_FIRSTNAME, ADMIN_LASTNAME, RESOURCE, ACTION, MESSAGE, REQUEST, CREATED_AT, UPDATED_AT FROM admin_log WHERE ID = :p0';
|
||||
try {
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
|
||||
@@ -365,6 +373,35 @@ abstract class AdminLogQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(AdminLogTableMap::ADMIN_LASTNAME, $adminLastname, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the resource column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByResource('fooValue'); // WHERE resource = 'fooValue'
|
||||
* $query->filterByResource('%fooValue%'); // WHERE resource LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $resource The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByResource($resource = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($resource)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $resource)) {
|
||||
$resource = str_replace('*', '%', $resource);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogTableMap::RESOURCE, $resource, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the action column
|
||||
*
|
||||
@@ -394,6 +431,35 @@ abstract class AdminLogQuery extends ModelCriteria
|
||||
return $this->addUsingAlias(AdminLogTableMap::ACTION, $action, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the message column
|
||||
*
|
||||
* Example usage:
|
||||
* <code>
|
||||
* $query->filterByMessage('fooValue'); // WHERE message = 'fooValue'
|
||||
* $query->filterByMessage('%fooValue%'); // WHERE message LIKE '%fooValue%'
|
||||
* </code>
|
||||
*
|
||||
* @param string $message The value to use as filter.
|
||||
* Accepts wildcards (* and % trigger a LIKE)
|
||||
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
|
||||
*
|
||||
* @return ChildAdminLogQuery The current query, for fluid interface
|
||||
*/
|
||||
public function filterByMessage($message = null, $comparison = null)
|
||||
{
|
||||
if (null === $comparison) {
|
||||
if (is_array($message)) {
|
||||
$comparison = Criteria::IN;
|
||||
} elseif (preg_match('/[\%\*]/', $message)) {
|
||||
$message = str_replace('*', '%', $message);
|
||||
$comparison = Criteria::LIKE;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->addUsingAlias(AdminLogTableMap::MESSAGE, $message, $comparison);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query on the request column
|
||||
*
|
||||
|
||||
@@ -57,7 +57,7 @@ class AdminLogTableMap extends TableMap
|
||||
/**
|
||||
* The total number of columns
|
||||
*/
|
||||
const NUM_COLUMNS = 8;
|
||||
const NUM_COLUMNS = 10;
|
||||
|
||||
/**
|
||||
* The number of lazy-loaded columns
|
||||
@@ -67,7 +67,7 @@ class AdminLogTableMap extends TableMap
|
||||
/**
|
||||
* The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
|
||||
*/
|
||||
const NUM_HYDRATE_COLUMNS = 8;
|
||||
const NUM_HYDRATE_COLUMNS = 10;
|
||||
|
||||
/**
|
||||
* the column name for the ID field
|
||||
@@ -89,11 +89,21 @@ class AdminLogTableMap extends TableMap
|
||||
*/
|
||||
const ADMIN_LASTNAME = 'admin_log.ADMIN_LASTNAME';
|
||||
|
||||
/**
|
||||
* the column name for the RESOURCE field
|
||||
*/
|
||||
const RESOURCE = 'admin_log.RESOURCE';
|
||||
|
||||
/**
|
||||
* the column name for the ACTION field
|
||||
*/
|
||||
const ACTION = 'admin_log.ACTION';
|
||||
|
||||
/**
|
||||
* the column name for the MESSAGE field
|
||||
*/
|
||||
const MESSAGE = 'admin_log.MESSAGE';
|
||||
|
||||
/**
|
||||
* the column name for the REQUEST field
|
||||
*/
|
||||
@@ -121,12 +131,12 @@ class AdminLogTableMap extends TableMap
|
||||
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
|
||||
*/
|
||||
protected static $fieldNames = array (
|
||||
self::TYPE_PHPNAME => array('Id', 'AdminLogin', 'AdminFirstname', 'AdminLastname', 'Action', 'Request', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'adminLogin', 'adminFirstname', 'adminLastname', 'action', 'request', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(AdminLogTableMap::ID, AdminLogTableMap::ADMIN_LOGIN, AdminLogTableMap::ADMIN_FIRSTNAME, AdminLogTableMap::ADMIN_LASTNAME, AdminLogTableMap::ACTION, AdminLogTableMap::REQUEST, AdminLogTableMap::CREATED_AT, AdminLogTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'ADMIN_LOGIN', 'ADMIN_FIRSTNAME', 'ADMIN_LASTNAME', 'ACTION', 'REQUEST', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'admin_login', 'admin_firstname', 'admin_lastname', 'action', 'request', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
self::TYPE_PHPNAME => array('Id', 'AdminLogin', 'AdminFirstname', 'AdminLastname', 'Resource', 'Action', 'Message', 'Request', 'CreatedAt', 'UpdatedAt', ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id', 'adminLogin', 'adminFirstname', 'adminLastname', 'resource', 'action', 'message', 'request', 'createdAt', 'updatedAt', ),
|
||||
self::TYPE_COLNAME => array(AdminLogTableMap::ID, AdminLogTableMap::ADMIN_LOGIN, AdminLogTableMap::ADMIN_FIRSTNAME, AdminLogTableMap::ADMIN_LASTNAME, AdminLogTableMap::RESOURCE, AdminLogTableMap::ACTION, AdminLogTableMap::MESSAGE, AdminLogTableMap::REQUEST, AdminLogTableMap::CREATED_AT, AdminLogTableMap::UPDATED_AT, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID', 'ADMIN_LOGIN', 'ADMIN_FIRSTNAME', 'ADMIN_LASTNAME', 'RESOURCE', 'ACTION', 'MESSAGE', 'REQUEST', 'CREATED_AT', 'UPDATED_AT', ),
|
||||
self::TYPE_FIELDNAME => array('id', 'admin_login', 'admin_firstname', 'admin_lastname', 'resource', 'action', 'message', 'request', 'created_at', 'updated_at', ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -136,12 +146,12 @@ class AdminLogTableMap extends TableMap
|
||||
* e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
|
||||
*/
|
||||
protected static $fieldKeys = array (
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'AdminLogin' => 1, 'AdminFirstname' => 2, 'AdminLastname' => 3, 'Action' => 4, 'Request' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'adminLogin' => 1, 'adminFirstname' => 2, 'adminLastname' => 3, 'action' => 4, 'request' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
|
||||
self::TYPE_COLNAME => array(AdminLogTableMap::ID => 0, AdminLogTableMap::ADMIN_LOGIN => 1, AdminLogTableMap::ADMIN_FIRSTNAME => 2, AdminLogTableMap::ADMIN_LASTNAME => 3, AdminLogTableMap::ACTION => 4, AdminLogTableMap::REQUEST => 5, AdminLogTableMap::CREATED_AT => 6, AdminLogTableMap::UPDATED_AT => 7, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'ADMIN_LOGIN' => 1, 'ADMIN_FIRSTNAME' => 2, 'ADMIN_LASTNAME' => 3, 'ACTION' => 4, 'REQUEST' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'admin_login' => 1, 'admin_firstname' => 2, 'admin_lastname' => 3, 'action' => 4, 'request' => 5, 'created_at' => 6, 'updated_at' => 7, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, )
|
||||
self::TYPE_PHPNAME => array('Id' => 0, 'AdminLogin' => 1, 'AdminFirstname' => 2, 'AdminLastname' => 3, 'Resource' => 4, 'Action' => 5, 'Message' => 6, 'Request' => 7, 'CreatedAt' => 8, 'UpdatedAt' => 9, ),
|
||||
self::TYPE_STUDLYPHPNAME => array('id' => 0, 'adminLogin' => 1, 'adminFirstname' => 2, 'adminLastname' => 3, 'resource' => 4, 'action' => 5, 'message' => 6, 'request' => 7, 'createdAt' => 8, 'updatedAt' => 9, ),
|
||||
self::TYPE_COLNAME => array(AdminLogTableMap::ID => 0, AdminLogTableMap::ADMIN_LOGIN => 1, AdminLogTableMap::ADMIN_FIRSTNAME => 2, AdminLogTableMap::ADMIN_LASTNAME => 3, AdminLogTableMap::RESOURCE => 4, AdminLogTableMap::ACTION => 5, AdminLogTableMap::MESSAGE => 6, AdminLogTableMap::REQUEST => 7, AdminLogTableMap::CREATED_AT => 8, AdminLogTableMap::UPDATED_AT => 9, ),
|
||||
self::TYPE_RAW_COLNAME => array('ID' => 0, 'ADMIN_LOGIN' => 1, 'ADMIN_FIRSTNAME' => 2, 'ADMIN_LASTNAME' => 3, 'RESOURCE' => 4, 'ACTION' => 5, 'MESSAGE' => 6, 'REQUEST' => 7, 'CREATED_AT' => 8, 'UPDATED_AT' => 9, ),
|
||||
self::TYPE_FIELDNAME => array('id' => 0, 'admin_login' => 1, 'admin_firstname' => 2, 'admin_lastname' => 3, 'resource' => 4, 'action' => 5, 'message' => 6, 'request' => 7, 'created_at' => 8, 'updated_at' => 9, ),
|
||||
self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, )
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -164,8 +174,10 @@ class AdminLogTableMap extends TableMap
|
||||
$this->addColumn('ADMIN_LOGIN', 'AdminLogin', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('ADMIN_FIRSTNAME', 'AdminFirstname', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('ADMIN_LASTNAME', 'AdminLastname', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('RESOURCE', 'Resource', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('ACTION', 'Action', 'VARCHAR', false, 255, null);
|
||||
$this->addColumn('REQUEST', 'Request', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('MESSAGE', 'Message', 'LONGVARCHAR', false, null, null);
|
||||
$this->addColumn('REQUEST', 'Request', 'CLOB', false, null, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
@@ -332,7 +344,9 @@ class AdminLogTableMap extends TableMap
|
||||
$criteria->addSelectColumn(AdminLogTableMap::ADMIN_LOGIN);
|
||||
$criteria->addSelectColumn(AdminLogTableMap::ADMIN_FIRSTNAME);
|
||||
$criteria->addSelectColumn(AdminLogTableMap::ADMIN_LASTNAME);
|
||||
$criteria->addSelectColumn(AdminLogTableMap::RESOURCE);
|
||||
$criteria->addSelectColumn(AdminLogTableMap::ACTION);
|
||||
$criteria->addSelectColumn(AdminLogTableMap::MESSAGE);
|
||||
$criteria->addSelectColumn(AdminLogTableMap::REQUEST);
|
||||
$criteria->addSelectColumn(AdminLogTableMap::CREATED_AT);
|
||||
$criteria->addSelectColumn(AdminLogTableMap::UPDATED_AT);
|
||||
@@ -341,7 +355,9 @@ class AdminLogTableMap extends TableMap
|
||||
$criteria->addSelectColumn($alias . '.ADMIN_LOGIN');
|
||||
$criteria->addSelectColumn($alias . '.ADMIN_FIRSTNAME');
|
||||
$criteria->addSelectColumn($alias . '.ADMIN_LASTNAME');
|
||||
$criteria->addSelectColumn($alias . '.RESOURCE');
|
||||
$criteria->addSelectColumn($alias . '.ACTION');
|
||||
$criteria->addSelectColumn($alias . '.MESSAGE');
|
||||
$criteria->addSelectColumn($alias . '.REQUEST');
|
||||
$criteria->addSelectColumn($alias . '.CREATED_AT');
|
||||
$criteria->addSelectColumn($alias . '.UPDATED_AT');
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Thelia\Model\Base\Module as BaseModule;
|
||||
|
||||
class Module extends BaseModule {
|
||||
|
||||
public function postSave(ConnectionInterface $con = null)
|
||||
{
|
||||
ModuleQuery::resetActivated();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,26 @@ use Thelia\Model\Base\ModuleQuery as BaseModuleQuery;
|
||||
*
|
||||
*/
|
||||
class ModuleQuery extends BaseModuleQuery {
|
||||
|
||||
protected static $activated = null;
|
||||
/**
|
||||
* @return array|mixed|\PropelObjectCollection
|
||||
*/
|
||||
public static function getActivated()
|
||||
{
|
||||
return self::create()
|
||||
->filterByActivate(1)
|
||||
->find();
|
||||
if(null === self::$activated) {
|
||||
self::$activated = self::create()
|
||||
->filterByActivate(1)
|
||||
->find();
|
||||
}
|
||||
|
||||
return self::$activated;
|
||||
}
|
||||
|
||||
public static function resetActivated()
|
||||
{
|
||||
self::$activated = null;
|
||||
}
|
||||
|
||||
|
||||
} // ModuleQuery
|
||||
|
||||
@@ -118,20 +118,6 @@ class FileManager
|
||||
$directory = $this->getUploadDir($parentType, $fileType);
|
||||
$fileName = $this->renameFile($model->getId(), $uploadedFile);
|
||||
|
||||
$this->adminLogAppend(
|
||||
$this->translator->trans(
|
||||
'Uploading %type% %fileName% to %directory% for parent_id %parentId% (%parentType%)',
|
||||
array(
|
||||
'%type%' => $fileType,
|
||||
'%fileName%' => $uploadedFile->getClientOriginalName(),
|
||||
'%directory%' => $directory . '/' . $fileName,
|
||||
'%parentId%' => $parentId,
|
||||
'%parentType%' => $parentType
|
||||
),
|
||||
'image'
|
||||
)
|
||||
);
|
||||
|
||||
$newUploadedFile = $uploadedFile->move($directory, $fileName);
|
||||
$model->setFile($fileName);
|
||||
|
||||
@@ -282,20 +268,6 @@ class FileManager
|
||||
return strtolower(preg_replace('/[^a-zA-Z0-9-_\.]/', '', $string));
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to append a message to the admin log.
|
||||
*
|
||||
* @param string $message
|
||||
*/
|
||||
public function adminLogAppend($message)
|
||||
{
|
||||
AdminLog::append(
|
||||
$message,
|
||||
$this->container->get('request'),
|
||||
$this->container->get('thelia.securityContext')->getAdminUser()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete image from file storage and database
|
||||
*
|
||||
|
||||
@@ -984,6 +984,7 @@ CREATE TABLE `admin`
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE INDEX `login_UNIQUE` (`login`),
|
||||
INDEX `idx_admin_profile_id` (`profile_id`),
|
||||
CONSTRAINT `fk_admin_profile_id`
|
||||
FOREIGN KEY (`profile_id`)
|
||||
@@ -1138,8 +1139,10 @@ CREATE TABLE `admin_log`
|
||||
`admin_login` VARCHAR(255),
|
||||
`admin_firstname` VARCHAR(255),
|
||||
`admin_lastname` VARCHAR(255),
|
||||
`resource` VARCHAR(255),
|
||||
`action` VARCHAR(255),
|
||||
`request` TEXT,
|
||||
`message` TEXT,
|
||||
`request` LONGTEXT,
|
||||
`created_at` DATETIME,
|
||||
`updated_at` DATETIME,
|
||||
PRIMARY KEY (`id`)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>string
|
||||
|
||||
<config xmlns="http://thelia.net/schema/dic/config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
|
||||
@@ -26,7 +26,7 @@ if exist local\config\database.yml (
|
||||
php install\faker.php
|
||||
|
||||
echo [INFO] Adding admin
|
||||
php Thelia thelia:create-admin
|
||||
php Thelia admin:create
|
||||
|
||||
echo [SUCCESS] Reset done
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ echo -e "\n\033[01;34m[INFO] Installing fixtures\033[00m\n"
|
||||
php install/faker.php
|
||||
|
||||
echo -e "\n\033[01;34m[INFO] Adding admin\033[00m\n"
|
||||
php Thelia thelia:create-admin --login_name thelia2 --password thelia2 --last_name thelia2 --first_name thelia2
|
||||
php Thelia admin:create --login_name thelia2 --password thelia2 --last_name thelia2 --first_name thelia2
|
||||
|
||||
echo -e "\n\033[01;34m[INFO] Clearing caches\033[00m\n"
|
||||
php Thelia cache:clear
|
||||
|
||||
227
templates/admin/default/admin-logs.html
Executable file
227
templates/admin/default/admin-logs.html
Executable file
@@ -0,0 +1,227 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Thelia Mailing System'}{/block}
|
||||
|
||||
{block name="check-resource"}admin.configuration.admin-logs{/block}
|
||||
{block name="check-access"}view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="admin-logs">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration/adminLogs'}">{intl l="Administration logs"}</a></li>
|
||||
</ul>
|
||||
|
||||
{module_include location='admin_logs_top'}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<div class="title title-without-tabs">{intl l="Administration logs"}</div>
|
||||
|
||||
<div class="row inner-toolbar">
|
||||
<div class="col-md-12 inner-actions clearfix">
|
||||
<button type="button" class="btn btn-default btn-success pull-right js-show-logs" title="{intl l='Show logs'}">{intl l='Show logs'} <span class="glyphicon glyphicon-eye-open"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 clearfix">
|
||||
<div>
|
||||
<strong>{intl l='Period'} :</strong>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3 clearfix">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{intl l='From'}</span>
|
||||
<input class="form-control" type="text" id="from_date" readonly="readonly">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default js-show-datepicker" data-datepicker-selector="#from_date" type="button">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 clearfix input-group">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">{intl l='To'}</span>
|
||||
<input class="form-control" type="text" id="to_date" readonly="readonly">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default js-show-datepicker" data-datepicker-selector="#to_date" type="button">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 clearfix">
|
||||
<div>
|
||||
<strong>{intl l='Administrators'} :</strong>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{loop type="admin" name="admin-list" backend_context="1"}
|
||||
{if ($LOOP_COUNT-1)%4 == 0 AND $LOOP_COUNT != 0 AND $LOOP_COUNT != $LOOP_TOTAL}
|
||||
</div>
|
||||
<div class="row">
|
||||
{/if}
|
||||
<div class="col-md-3">
|
||||
<input id="admin_{$ID}" data-id="{$LOGIN}" class="js-admin" type="checkbox" checked>
|
||||
<label for="admin_{$ID}" style="font-weight: normal;">{$LOGIN} ({$FIRSTNAME|upper} {$LASTNAME|ucwords})</label>
|
||||
</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 clearfix">
|
||||
<div>
|
||||
<strong>{intl l='Resources'} :</strong>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{loop type="resource" name="resources-list" backend_context="1"}
|
||||
{if ($LOOP_COUNT-1)%4 == 0 AND $LOOP_COUNT != 0 AND $LOOP_COUNT != $LOOP_TOTAL}
|
||||
</div>
|
||||
<div class="row">
|
||||
{/if}
|
||||
<div class="col-md-3">
|
||||
<input id="resource_{$ID}" data-id="{$CODE}" class="js-resource" type="checkbox" checked>
|
||||
<label for="resource_{$ID}" style="font-weight: normal;">{$TITLE}</label>
|
||||
</div>
|
||||
{/loop}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 clearfix">
|
||||
<div>
|
||||
<strong>{intl l='Modules'} :</strong>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{loop type="module" name="modules-list" backend_context="1"}
|
||||
{if ($LOOP_COUNT-1)%4 == 0 AND $LOOP_COUNT != 0 AND $LOOP_COUNT != $LOOP_TOTAL}
|
||||
</div>
|
||||
<div class="row">
|
||||
{/if}
|
||||
<div class="col-md-3">
|
||||
<input id="module_{$ID}" data-id="{$CODE}" class="js-module" type="checkbox" checked>
|
||||
<label for="module_{$ID}" style="font-weight: normal;">{$TITLE}</label>
|
||||
</div>
|
||||
{/loop}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row inner-toolbar">
|
||||
<div class="col-md-12 inner-actions clearfix">
|
||||
<button type="button" class="btn btn-default btn-success pull-right js-show-logs" title="{intl l='Show logs'}">{intl l='Show logs'} <span class="glyphicon glyphicon-eye-open"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="loading-block" class="col-md-12 loading-block"></div>
|
||||
|
||||
<div class="col-md-12 clearfix" id="logger-display"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='admin_logs_bottom'}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{stylesheets file='assets/js/jquery.ui/jquery.ui.theme.css'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
{stylesheets file='assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.css'}
|
||||
<link rel="stylesheet" href="{$asset_url}">
|
||||
{/stylesheets}
|
||||
|
||||
{javascripts file="assets/js/jquery/jquery.ui.ui.datepicker/i18n/jquery.ui.datepicker-{lang attr="locale"}.js" catchException="true"}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery(function($) {
|
||||
|
||||
$('#from_date').datepicker({
|
||||
maxDate: "-1d",
|
||||
showOn: 'manual'
|
||||
});
|
||||
$('#from_date').datepicker( "setDate", "-7d" );
|
||||
|
||||
$('#to_date').datepicker({
|
||||
maxDate: "0",
|
||||
showOn: 'manual'
|
||||
});
|
||||
$('#to_date').datepicker( "setDate", "0" );
|
||||
|
||||
$('.js-show-datepicker').click(function(e){
|
||||
$($(this).data('datepicker-selector')).datepicker('show');
|
||||
});
|
||||
|
||||
$('.js-show-logs').click(function(e) {
|
||||
|
||||
$('.js-show-logs').attr('disabled', true);
|
||||
$('#logger-display').html('');
|
||||
$('#loading-block').show();
|
||||
|
||||
var admins = new Array();
|
||||
var resources = new Array();
|
||||
var modules = new Array();
|
||||
|
||||
$('.js-admin:checked').each(function(k, v) {
|
||||
admins.push($(v).data('id'));
|
||||
})
|
||||
$('.js-resource:checked').each(function(k, v) {
|
||||
resources.push($(v).data('id'));
|
||||
})
|
||||
$('.js-module:checked').each(function(k, v) {
|
||||
modules.push($(v).data('id'));
|
||||
})
|
||||
|
||||
var fromDate = new Date( $('#from_date').datepicker( "getDate" ) );
|
||||
var toDate = new Date( $('#to_date').datepicker( "getDate" ) );
|
||||
|
||||
$.post(
|
||||
"{url path='/admin/configuration/adminLogs/logger'}",
|
||||
{
|
||||
fromDate: $.datepicker.formatDate("yy-mm-dd", fromDate),
|
||||
toDate: $.datepicker.formatDate("yy-mm-dd", toDate),
|
||||
admins: admins,
|
||||
resources: resources,
|
||||
modules: modules
|
||||
},
|
||||
function(html) {
|
||||
$('#loading-block').hide();
|
||||
$('#logger-display').html(html);
|
||||
$('.js-show-logs').attr('disabled', false);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
@@ -62,13 +62,20 @@
|
||||
</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.administrator" access="UPDATE"}
|
||||
{* if admin is current admin :
|
||||
- can UPDATE anyway
|
||||
- cannot delete himself
|
||||
*}
|
||||
{if $ID == {admin attr="id"}}
|
||||
<a class="btn btn-default btn-xs js-update-administrator" title="{intl l='Change this administrator'}" href="#administrator_update_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-edit"></span></a>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.administrator" access="DELETE"}
|
||||
<a class="btn btn-default btn-xs js-delete-administrator" title="{intl l='Delete this administrator'}" href="#administrator_delete_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
{/loop}
|
||||
{else}
|
||||
{loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.administrator" access="UPDATE"}
|
||||
<a class="btn btn-default btn-xs js-update-administrator" title="{intl l='Change this administrator'}" href="#administrator_update_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-edit"></span></a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_delete" role="ADMIN" resource="admin.configuration.administrator" access="DELETE"}
|
||||
<a class="btn btn-default btn-xs js-delete-administrator" title="{intl l='Delete this administrator'}" href="#administrator_delete_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
{/loop}
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
13
templates/admin/default/ajax/logger.html
Normal file
13
templates/admin/default/ajax/logger.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<div class="logger">
|
||||
<ul id="logger-content">
|
||||
{foreach $entries as $entry}
|
||||
<li class="entry">
|
||||
<span class="head">{$entry.head}</span>
|
||||
:
|
||||
<span class="data">{$entry.data}</span>
|
||||
</li>
|
||||
{foreachelse}
|
||||
<li class="no-entry">NO ENTRIES FOUND</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -1,474 +0,0 @@
|
||||
///* =========================================================
|
||||
// * bootstrap-datepicker.js
|
||||
// * http://www.eyecon.ro/bootstrap-datepicker
|
||||
// * =========================================================
|
||||
// * Copyright 2012 Stefan Petre
|
||||
// *
|
||||
// * Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// * you may not use this file except in compliance with the License.
|
||||
// * You may obtain a copy of the License at
|
||||
// *
|
||||
// * http://www.apache.org/licenses/LICENSE-2.0
|
||||
// *
|
||||
// * Unless required by applicable law or agreed to in writing, software
|
||||
// * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// * See the License for the specific language governing permissions and
|
||||
// * limitations under the License.
|
||||
// * ========================================================= */
|
||||
//
|
||||
//!function( $ ) {
|
||||
//
|
||||
// // Picker object
|
||||
//
|
||||
// var Datepicker = function(element, options){
|
||||
// this.element = $(element);
|
||||
// this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
|
||||
// this.picker = $(DPGlobal.template)
|
||||
// .appendTo('body')
|
||||
// .on({
|
||||
// click: $.proxy(this.click, this)//,
|
||||
// //mousedown: $.proxy(this.mousedown, this)
|
||||
// });
|
||||
// this.isInput = this.element.is('input');
|
||||
// this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
|
||||
//
|
||||
// if (this.isInput) {
|
||||
// this.element.on({
|
||||
// focus: $.proxy(this.show, this),
|
||||
// //blur: $.proxy(this.hide, this),
|
||||
// keyup: $.proxy(this.update, this)
|
||||
// });
|
||||
// } else {
|
||||
// if (this.component){
|
||||
// this.component.on('click', $.proxy(this.show, this));
|
||||
// } else {
|
||||
// this.element.on('click', $.proxy(this.show, this));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0;
|
||||
// if (typeof this.minViewMode === 'string') {
|
||||
// switch (this.minViewMode) {
|
||||
// case 'months':
|
||||
// this.minViewMode = 1;
|
||||
// break;
|
||||
// case 'years':
|
||||
// this.minViewMode = 2;
|
||||
// break;
|
||||
// default:
|
||||
// this.minViewMode = 0;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// this.viewMode = options.viewMode||this.element.data('date-viewmode')||0;
|
||||
// if (typeof this.viewMode === 'string') {
|
||||
// switch (this.viewMode) {
|
||||
// case 'months':
|
||||
// this.viewMode = 1;
|
||||
// break;
|
||||
// case 'years':
|
||||
// this.viewMode = 2;
|
||||
// break;
|
||||
// default:
|
||||
// this.viewMode = 0;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// this.startViewMode = this.viewMode;
|
||||
// this.weekStart = options.weekStart||this.element.data('date-weekstart')||0;
|
||||
// this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
|
||||
// this.onRender = options.onRender;
|
||||
// this.fillDow();
|
||||
// this.fillMonths();
|
||||
// this.update();
|
||||
// this.showMode();
|
||||
// };
|
||||
//
|
||||
// Datepicker.prototype = {
|
||||
// constructor: Datepicker,
|
||||
//
|
||||
// show: function(e) {
|
||||
// this.picker.show();
|
||||
// this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
|
||||
// this.place();
|
||||
// $(window).on('resize', $.proxy(this.place, this));
|
||||
// if (e ) {
|
||||
// e.stopPropagation();
|
||||
// e.preventDefault();
|
||||
// }
|
||||
// if (!this.isInput) {
|
||||
// }
|
||||
// var that = this;
|
||||
// $(document).on('mousedown', function(ev){
|
||||
// if ($(ev.target).closest('.datepicker').length == 0) {
|
||||
// that.hide();
|
||||
// }
|
||||
// });
|
||||
// this.element.trigger({
|
||||
// type: 'show',
|
||||
// date: this.date
|
||||
// });
|
||||
// },
|
||||
//
|
||||
// hide: function(){
|
||||
// this.picker.hide();
|
||||
// $(window).off('resize', this.place);
|
||||
// this.viewMode = this.startViewMode;
|
||||
// this.showMode();
|
||||
// if (!this.isInput) {
|
||||
// $(document).off('mousedown', this.hide);
|
||||
// }
|
||||
// //this.set();
|
||||
// this.element.trigger({
|
||||
// type: 'hide',
|
||||
// date: this.date
|
||||
// });
|
||||
// },
|
||||
//
|
||||
// set: function() {
|
||||
// var formated = DPGlobal.formatDate(this.date, this.format);
|
||||
// if (!this.isInput) {
|
||||
// if (this.component){
|
||||
// this.element.find('input').prop('value', formated);
|
||||
// }
|
||||
// this.element.data('date', formated);
|
||||
// } else {
|
||||
// this.element.prop('value', formated);
|
||||
// }
|
||||
// },
|
||||
//
|
||||
// setValue: function(newDate) {
|
||||
// if (typeof newDate === 'string') {
|
||||
// this.date = DPGlobal.parseDate(newDate, this.format);
|
||||
// } else {
|
||||
// this.date = new Date(newDate);
|
||||
// }
|
||||
// this.set();
|
||||
// this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
||||
// this.fill();
|
||||
// },
|
||||
//
|
||||
// place: function(){
|
||||
// var offset = this.component ? this.component.offset() : this.element.offset();
|
||||
// this.picker.css({
|
||||
// top: offset.top + this.height,
|
||||
// left: offset.left
|
||||
// });
|
||||
// },
|
||||
//
|
||||
// update: function(newDate){
|
||||
// this.date = DPGlobal.parseDate(
|
||||
// typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')),
|
||||
// this.format
|
||||
// );
|
||||
// this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
||||
// this.fill();
|
||||
// },
|
||||
//
|
||||
// fillDow: function(){
|
||||
// var dowCnt = this.weekStart;
|
||||
// var html = '<tr>';
|
||||
// while (dowCnt < this.weekStart + 7) {
|
||||
// html += '<th class="dow">'+DPGlobal.dates.daysMin[(dowCnt++)%7]+'</th>';
|
||||
// }
|
||||
// html += '</tr>';
|
||||
// this.picker.find('.datepicker-days thead').append(html);
|
||||
// },
|
||||
//
|
||||
// fillMonths: function(){
|
||||
// var html = '';
|
||||
// var i = 0
|
||||
// while (i < 12) {
|
||||
// html += '<span class="month">'+DPGlobal.dates.monthsShort[i++]+'</span>';
|
||||
// }
|
||||
// this.picker.find('.datepicker-months td').append(html);
|
||||
// },
|
||||
//
|
||||
// fill: function() {
|
||||
// var d = new Date(this.viewDate),
|
||||
// year = d.getFullYear(),
|
||||
// month = d.getMonth(),
|
||||
// currentDate = this.date.valueOf();
|
||||
// this.picker.find('.datepicker-days th:eq(1)')
|
||||
// .text(DPGlobal.dates.months[month]+' '+year);
|
||||
// var prevMonth = new Date(year, month-1, 28,0,0,0,0),
|
||||
// day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
|
||||
// prevMonth.setDate(day);
|
||||
// prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
|
||||
// var nextMonth = new Date(prevMonth);
|
||||
// nextMonth.setDate(nextMonth.getDate() + 42);
|
||||
// nextMonth = nextMonth.valueOf();
|
||||
// var html = [];
|
||||
// var clsName,
|
||||
// prevY,
|
||||
// prevM;
|
||||
// while(prevMonth.valueOf() < nextMonth) {
|
||||
// if (prevMonth.getDay() === this.weekStart) {
|
||||
// html.push('<tr>');
|
||||
// }
|
||||
// clsName = this.onRender(prevMonth);
|
||||
// prevY = prevMonth.getFullYear();
|
||||
// prevM = prevMonth.getMonth();
|
||||
// if ((prevM < month && prevY === year) || prevY < year) {
|
||||
// clsName += ' old';
|
||||
// } else if ((prevM > month && prevY === year) || prevY > year) {
|
||||
// clsName += ' new';
|
||||
// }
|
||||
// if (prevMonth.valueOf() === currentDate) {
|
||||
// clsName += ' active';
|
||||
// }
|
||||
// html.push('<td class="day '+clsName+'">'+prevMonth.getDate() + '</td>');
|
||||
// if (prevMonth.getDay() === this.weekEnd) {
|
||||
// html.push('</tr>');
|
||||
// }
|
||||
// prevMonth.setDate(prevMonth.getDate()+1);
|
||||
// }
|
||||
// this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
|
||||
// var currentYear = this.date.getFullYear();
|
||||
//
|
||||
// var months = this.picker.find('.datepicker-months')
|
||||
// .find('th:eq(1)')
|
||||
// .text(year)
|
||||
// .end()
|
||||
// .find('span').removeClass('active');
|
||||
// if (currentYear === year) {
|
||||
// months.eq(this.date.getMonth()).addClass('active');
|
||||
// }
|
||||
//
|
||||
// html = '';
|
||||
// year = parseInt(year/10, 10) * 10;
|
||||
// var yearCont = this.picker.find('.datepicker-years')
|
||||
// .find('th:eq(1)')
|
||||
// .text(year + '-' + (year + 9))
|
||||
// .end()
|
||||
// .find('td');
|
||||
// year -= 1;
|
||||
// for (var i = -1; i < 11; i++) {
|
||||
// html += '<span class="year'+(i === -1 || i === 10 ? ' old' : '')+(currentYear === year ? ' active' : '')+'">'+year+'</span>';
|
||||
// year += 1;
|
||||
// }
|
||||
// yearCont.html(html);
|
||||
// },
|
||||
//
|
||||
// click: function(e) {
|
||||
// e.stopPropagation();
|
||||
// e.preventDefault();
|
||||
// var target = $(e.target).closest('span, td, th');
|
||||
// if (target.length === 1) {
|
||||
// switch(target[0].nodeName.toLowerCase()) {
|
||||
// case 'th':
|
||||
// switch(target[0].className) {
|
||||
// case 'switch':
|
||||
// this.showMode(1);
|
||||
// break;
|
||||
// case 'prev':
|
||||
// case 'next':
|
||||
// this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
|
||||
// this.viewDate,
|
||||
// this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
|
||||
// DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1)
|
||||
// );
|
||||
// this.fill();
|
||||
// this.set();
|
||||
// break;
|
||||
// }
|
||||
// break;
|
||||
// case 'span':
|
||||
// if (target.is('.month')) {
|
||||
// var month = target.parent().find('span').index(target);
|
||||
// this.viewDate.setMonth(month);
|
||||
// } else {
|
||||
// var year = parseInt(target.text(), 10)||0;
|
||||
// this.viewDate.setFullYear(year);
|
||||
// }
|
||||
// if (this.viewMode !== 0) {
|
||||
// this.date = new Date(this.viewDate);
|
||||
// this.element.trigger({
|
||||
// type: 'changeDate',
|
||||
// date: this.date,
|
||||
// viewMode: DPGlobal.modes[this.viewMode].clsName
|
||||
// });
|
||||
// }
|
||||
// this.showMode(-1);
|
||||
// this.fill();
|
||||
// this.set();
|
||||
// break;
|
||||
// case 'td':
|
||||
// if (target.is('.day') && !target.is('.disabled')){
|
||||
// var day = parseInt(target.text(), 10)||1;
|
||||
// var month = this.viewDate.getMonth();
|
||||
// if (target.is('.old')) {
|
||||
// month -= 1;
|
||||
// } else if (target.is('.new')) {
|
||||
// month += 1;
|
||||
// }
|
||||
// var year = this.viewDate.getFullYear();
|
||||
// this.date = new Date(year, month, day,0,0,0,0);
|
||||
// this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0);
|
||||
// this.fill();
|
||||
// this.set();
|
||||
// this.element.trigger({
|
||||
// type: 'changeDate',
|
||||
// date: this.date,
|
||||
// viewMode: DPGlobal.modes[this.viewMode].clsName
|
||||
// });
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
//
|
||||
// mousedown: function(e){
|
||||
// e.stopPropagation();
|
||||
// e.preventDefault();
|
||||
// },
|
||||
//
|
||||
// showMode: function(dir) {
|
||||
// if (dir) {
|
||||
// this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
|
||||
// }
|
||||
// this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// $.fn.datepicker = function ( option, val ) {
|
||||
// return this.each(function () {
|
||||
// var $this = $(this),
|
||||
// data = $this.data('datepicker'),
|
||||
// options = typeof option === 'object' && option;
|
||||
// if (!data) {
|
||||
// $this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
|
||||
// }
|
||||
// if (typeof option === 'string') data[option](val);
|
||||
// });
|
||||
// };
|
||||
//
|
||||
// $.fn.datepicker.defaults = {
|
||||
// onRender: function(date) {
|
||||
// return '';
|
||||
// }
|
||||
// };
|
||||
// $.fn.datepicker.Constructor = Datepicker;
|
||||
//
|
||||
// var DPGlobal = {
|
||||
// modes: [
|
||||
// {
|
||||
// clsName: 'days',
|
||||
// navFnc: 'Month',
|
||||
// navStep: 1
|
||||
// },
|
||||
// {
|
||||
// clsName: 'months',
|
||||
// navFnc: 'FullYear',
|
||||
// navStep: 1
|
||||
// },
|
||||
// {
|
||||
// clsName: 'years',
|
||||
// navFnc: 'FullYear',
|
||||
// navStep: 10
|
||||
// }],
|
||||
// dates:{
|
||||
// days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
|
||||
// daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
||||
// daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
|
||||
// months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
||||
// monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
||||
// },
|
||||
// isLeapYear: function (year) {
|
||||
// return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
|
||||
// },
|
||||
// getDaysInMonth: function (year, month) {
|
||||
// return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
|
||||
// },
|
||||
// parseFormat: function(format){
|
||||
// var separator = format.match(/[.\/\-\s].*?/),
|
||||
// parts = format.split(/\W+/);
|
||||
// if (!separator || !parts || parts.length === 0){
|
||||
// throw new Error("Invalid date format.");
|
||||
// }
|
||||
// return {separator: separator, parts: parts};
|
||||
// },
|
||||
// parseDate: function(date, format) {
|
||||
// var parts = date.split(format.separator),
|
||||
// date = new Date(),
|
||||
// val;
|
||||
// date.setHours(0);
|
||||
// date.setMinutes(0);
|
||||
// date.setSeconds(0);
|
||||
// date.setMilliseconds(0);
|
||||
// if (parts.length === format.parts.length) {
|
||||
// var year = date.getFullYear(), day = date.getDate(), month = date.getMonth();
|
||||
// for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
// val = parseInt(parts[i], 10)||1;
|
||||
// switch(format.parts[i]) {
|
||||
// case 'dd':
|
||||
// case 'd':
|
||||
// day = val;
|
||||
// date.setDate(val);
|
||||
// break;
|
||||
// case 'mm':
|
||||
// case 'm':
|
||||
// month = val - 1;
|
||||
// date.setMonth(val - 1);
|
||||
// break;
|
||||
// case 'yy':
|
||||
// year = 2000 + val;
|
||||
// date.setFullYear(2000 + val);
|
||||
// break;
|
||||
// case 'yyyy':
|
||||
// year = val;
|
||||
// date.setFullYear(val);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// date = new Date(year, month, day, 0 ,0 ,0);
|
||||
// }
|
||||
// return date;
|
||||
// },
|
||||
// formatDate: function(date, format){
|
||||
// var val = {
|
||||
// d: date.getDate(),
|
||||
// m: date.getMonth() + 1,
|
||||
// yy: date.getFullYear().toString().substring(2),
|
||||
// yyyy: date.getFullYear()
|
||||
// };
|
||||
// val.dd = (val.d < 10 ? '0' : '') + val.d;
|
||||
// val.mm = (val.m < 10 ? '0' : '') + val.m;
|
||||
// var date = [];
|
||||
// for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
||||
// date.push(val[format.parts[i]]);
|
||||
// }
|
||||
// return date.join(format.separator);
|
||||
// },
|
||||
// headTemplate: '<thead>'+
|
||||
// '<tr>'+
|
||||
// '<th class="prev">‹</th>'+
|
||||
// '<th colspan="5" class="switch"></th>'+
|
||||
// '<th class="next">›</th>'+
|
||||
// '</tr>'+
|
||||
// '</thead>',
|
||||
// contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
|
||||
// };
|
||||
// DPGlobal.template = '<div class="datepicker dropdown-menu">'+
|
||||
// '<div class="datepicker-days">'+
|
||||
// '<table class=" table-condensed">'+
|
||||
// DPGlobal.headTemplate+
|
||||
// '<tbody></tbody>'+
|
||||
// '</table>'+
|
||||
// '</div>'+
|
||||
// '<div class="datepicker-months">'+
|
||||
// '<table class="table-condensed">'+
|
||||
// DPGlobal.headTemplate+
|
||||
// DPGlobal.contTemplate+
|
||||
// '</table>'+
|
||||
// '</div>'+
|
||||
// '<div class="datepicker-years">'+
|
||||
// '<table class="table-condensed">'+
|
||||
// DPGlobal.headTemplate+
|
||||
// DPGlobal.contTemplate+
|
||||
// '</table>'+
|
||||
// '</div>'+
|
||||
// '</div>';
|
||||
//
|
||||
//}( window.jQuery );
|
||||
@@ -0,0 +1,23 @@
|
||||
/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
|
||||
/* Traducido por Vester (xvester@gmail.com). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['es_ES'] = {
|
||||
closeText: 'Cerrar',
|
||||
prevText: '<Ant',
|
||||
nextText: 'Sig>',
|
||||
currentText: 'Hoy',
|
||||
monthNames: ['enero','febrero','marzo','abril','mayo','junio',
|
||||
'julio','agosto','septiembre','octubre','noviembre','diciembre'],
|
||||
monthNamesShort: ['ene','feb','mar','abr','may','jun',
|
||||
'jul','ogo','sep','oct','nov','dic'],
|
||||
dayNames: ['domingo','lunes','martes','miércoles','jueves','viernes','sábado'],
|
||||
dayNamesShort: ['dom','lun','mar','mié','juv','vie','sáb'],
|
||||
dayNamesMin: ['D','L','M','X','J','V','S'],
|
||||
weekHeader: 'Sm',
|
||||
dateFormat: 'dd/mm/yy',
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ''};
|
||||
$.datepicker.setDefaults($.datepicker.regional['es_ES']);
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
/* French initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Keith Wood (kbwood{at}iinet.com.au),
|
||||
Stéphane Nahmani (sholby@sholby.net),
|
||||
Stéphane Raimbault <stephane.raimbault@gmail.com> */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['fr_FR'] = {
|
||||
closeText: 'Fermer',
|
||||
prevText: 'Précédent',
|
||||
nextText: 'Suivant',
|
||||
currentText: 'Aujourd\'hui',
|
||||
monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
|
||||
'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
|
||||
monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin',
|
||||
'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
|
||||
dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'],
|
||||
dayNamesShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'],
|
||||
dayNamesMin: ['D','L','M','M','J','V','S'],
|
||||
weekHeader: 'Sem.',
|
||||
dateFormat: 'dd/mm/yy',
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ''};
|
||||
$.datepicker.setDefaults($.datepicker.regional['fr_FR']);
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
/* Italian initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Antonello Pasella (antonello.pasella@gmail.com). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['it_IT'] = {
|
||||
closeText: 'Chiudi',
|
||||
prevText: '<Prec',
|
||||
nextText: 'Succ>',
|
||||
currentText: 'Oggi',
|
||||
monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno',
|
||||
'Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
|
||||
monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu',
|
||||
'Lug','Ago','Set','Ott','Nov','Dic'],
|
||||
dayNames: ['Domenica','Lunedì','Martedì','Mercoledì','Giovedì','Venerdì','Sabato'],
|
||||
dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
|
||||
dayNamesMin: ['Do','Lu','Ma','Me','Gi','Ve','Sa'],
|
||||
weekHeader: 'Sm',
|
||||
dateFormat: 'dd/mm/yy',
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ''};
|
||||
$.datepicker.setDefaults($.datepicker.regional['it_IT']);
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
JQuery UI datepicker localization files were found here : https://github.com/jquery/jquery-ui/tree/master/ui/i18n
|
||||
|
||||
Warning : You must change file name an localization array key declaration in file to match thelia lang locale.
|
||||
|
||||
Exemple : change fr with fr_FR
|
||||
175
templates/admin/default/assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.css
vendored
Normal file
175
templates/admin/default/assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.css
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
/*!
|
||||
* jQuery UI Datepicker @VERSION
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright 2013 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://api.jqueryui.com/datepicker/#theming
|
||||
*/
|
||||
.ui-datepicker {
|
||||
width: 17em;
|
||||
padding: .2em .2em 0;
|
||||
display: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-header {
|
||||
position: relative;
|
||||
padding: .2em 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev,
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
width: 1.8em;
|
||||
height: 1.8em;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover,
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
top: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev {
|
||||
left: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next {
|
||||
right: 2px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev-hover {
|
||||
left: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-next-hover {
|
||||
right: 1px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-prev span,
|
||||
.ui-datepicker .ui-datepicker-next span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -8px;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title {
|
||||
margin: 0 2.3em;
|
||||
line-height: 1.8em;
|
||||
text-align: center;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-title select {
|
||||
font-size: 1em;
|
||||
margin: 1px 0;
|
||||
}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year {
|
||||
width: 49%;
|
||||
}
|
||||
.ui-datepicker table {
|
||||
width: 100%;
|
||||
font-size: .9em;
|
||||
border-collapse: collapse;
|
||||
margin: 0 0 .4em;
|
||||
}
|
||||
.ui-datepicker th {
|
||||
padding: .7em .3em;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
border: 0;
|
||||
}
|
||||
.ui-datepicker td {
|
||||
border: 0;
|
||||
padding: 1px;
|
||||
}
|
||||
.ui-datepicker td span,
|
||||
.ui-datepicker td a {
|
||||
display: block;
|
||||
padding: .2em;
|
||||
text-align: right;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane {
|
||||
background-image: none;
|
||||
margin: .7em 0 0 0;
|
||||
padding: 0 .2em;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button {
|
||||
float: right;
|
||||
margin: .5em .2em .4em;
|
||||
cursor: pointer;
|
||||
padding: .2em .6em .3em .6em;
|
||||
width: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi {
|
||||
width: auto;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group table {
|
||||
width: 95%;
|
||||
margin: 0 auto .4em;
|
||||
}
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group {
|
||||
width: 50%;
|
||||
}
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group {
|
||||
width: 33.3%;
|
||||
}
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group {
|
||||
width: 25%;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-left-width: 0;
|
||||
}
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane {
|
||||
clear: left;
|
||||
}
|
||||
.ui-datepicker-row-break {
|
||||
clear: both;
|
||||
width: 100%;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev {
|
||||
right: 2px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next {
|
||||
left: 2px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover {
|
||||
right: 1px;
|
||||
left: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover {
|
||||
left: 1px;
|
||||
right: auto;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane {
|
||||
clear: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button {
|
||||
float: left;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
|
||||
.ui-datepicker-rtl .ui-datepicker-group {
|
||||
float: right;
|
||||
}
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
|
||||
border-right-width: 0;
|
||||
border-left-width: 1px;
|
||||
}
|
||||
2059
templates/admin/default/assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.js
vendored
Normal file
2059
templates/admin/default/assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
410
templates/admin/default/assets/js/jquery.ui/jquery.ui.theme.css
vendored
Normal file
410
templates/admin/default/assets/js/jquery.ui/jquery.ui.theme.css
vendored
Normal file
@@ -0,0 +1,410 @@
|
||||
/*!
|
||||
* jQuery UI CSS Framework @VERSION
|
||||
* http://jqueryui.com
|
||||
*
|
||||
* Copyright 2013 jQuery Foundation and other contributors
|
||||
* Released under the MIT license.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://api.jqueryui.com/category/theming/
|
||||
*
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/
|
||||
*/
|
||||
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget {
|
||||
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
|
||||
font-size: 1.1em/*{fsDefault}*/;
|
||||
}
|
||||
.ui-widget .ui-widget {
|
||||
font-size: 1em;
|
||||
}
|
||||
.ui-widget input,
|
||||
.ui-widget select,
|
||||
.ui-widget textarea,
|
||||
.ui-widget button {
|
||||
font-family: Verdana,Arial,sans-serif/*{ffDefault}*/;
|
||||
font-size: 1em;
|
||||
}
|
||||
.ui-widget-content {
|
||||
border: 1px solid #aaaaaa/*{borderColorContent}*/;
|
||||
background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/;
|
||||
color: #222222/*{fcContent}*/;
|
||||
}
|
||||
.ui-widget-content a {
|
||||
color: #222222/*{fcContent}*/;
|
||||
}
|
||||
.ui-widget-header {
|
||||
border: 1px solid #aaaaaa/*{borderColorHeader}*/;
|
||||
background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/;
|
||||
color: #222222/*{fcHeader}*/;
|
||||
font-weight: bold;
|
||||
}
|
||||
.ui-widget-header a {
|
||||
color: #222222/*{fcHeader}*/;
|
||||
}
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default,
|
||||
.ui-widget-content .ui-state-default,
|
||||
.ui-widget-header .ui-state-default {
|
||||
border: 1px solid #d3d3d3/*{borderColorDefault}*/;
|
||||
background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/;
|
||||
font-weight: normal/*{fwDefault}*/;
|
||||
color: #555555/*{fcDefault}*/;
|
||||
}
|
||||
.ui-state-default a,
|
||||
.ui-state-default a:link,
|
||||
.ui-state-default a:visited {
|
||||
color: #555555/*{fcDefault}*/;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-state-hover,
|
||||
.ui-widget-content .ui-state-hover,
|
||||
.ui-widget-header .ui-state-hover,
|
||||
.ui-state-focus,
|
||||
.ui-widget-content .ui-state-focus,
|
||||
.ui-widget-header .ui-state-focus {
|
||||
border: 1px solid #999999/*{borderColorHover}*/;
|
||||
background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/;
|
||||
font-weight: normal/*{fwDefault}*/;
|
||||
color: #212121/*{fcHover}*/;
|
||||
}
|
||||
.ui-state-hover a,
|
||||
.ui-state-hover a:hover,
|
||||
.ui-state-hover a:link,
|
||||
.ui-state-hover a:visited,
|
||||
.ui-state-focus a,
|
||||
.ui-state-focus a:hover,
|
||||
.ui-state-focus a:link,
|
||||
.ui-state-focus a:visited {
|
||||
color: #212121/*{fcHover}*/;
|
||||
text-decoration: none;
|
||||
}
|
||||
.ui-state-active,
|
||||
.ui-widget-content .ui-state-active,
|
||||
.ui-widget-header .ui-state-active {
|
||||
border: 1px solid #aaaaaa/*{borderColorActive}*/;
|
||||
background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/;
|
||||
font-weight: normal/*{fwDefault}*/;
|
||||
color: #212121/*{fcActive}*/;
|
||||
}
|
||||
.ui-state-active a,
|
||||
.ui-state-active a:link,
|
||||
.ui-state-active a:visited {
|
||||
color: #212121/*{fcActive}*/;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight,
|
||||
.ui-widget-content .ui-state-highlight,
|
||||
.ui-widget-header .ui-state-highlight {
|
||||
border: 1px solid #fcefa1/*{borderColorHighlight}*/;
|
||||
background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/;
|
||||
color: #363636/*{fcHighlight}*/;
|
||||
}
|
||||
.ui-state-highlight a,
|
||||
.ui-widget-content .ui-state-highlight a,
|
||||
.ui-widget-header .ui-state-highlight a {
|
||||
color: #363636/*{fcHighlight}*/;
|
||||
}
|
||||
.ui-state-error,
|
||||
.ui-widget-content .ui-state-error,
|
||||
.ui-widget-header .ui-state-error {
|
||||
border: 1px solid #cd0a0a/*{borderColorError}*/;
|
||||
background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/;
|
||||
color: #cd0a0a/*{fcError}*/;
|
||||
}
|
||||
.ui-state-error a,
|
||||
.ui-widget-content .ui-state-error a,
|
||||
.ui-widget-header .ui-state-error a {
|
||||
color: #cd0a0a/*{fcError}*/;
|
||||
}
|
||||
.ui-state-error-text,
|
||||
.ui-widget-content .ui-state-error-text,
|
||||
.ui-widget-header .ui-state-error-text {
|
||||
color: #cd0a0a/*{fcError}*/;
|
||||
}
|
||||
.ui-priority-primary,
|
||||
.ui-widget-content .ui-priority-primary,
|
||||
.ui-widget-header .ui-priority-primary {
|
||||
font-weight: bold;
|
||||
}
|
||||
.ui-priority-secondary,
|
||||
.ui-widget-content .ui-priority-secondary,
|
||||
.ui-widget-header .ui-priority-secondary {
|
||||
opacity: .7;
|
||||
filter:Alpha(Opacity=70);
|
||||
font-weight: normal;
|
||||
}
|
||||
.ui-state-disabled,
|
||||
.ui-widget-content .ui-state-disabled,
|
||||
.ui-widget-header .ui-state-disabled {
|
||||
opacity: .35;
|
||||
filter:Alpha(Opacity=35);
|
||||
background-image: none;
|
||||
}
|
||||
.ui-state-disabled .ui-icon {
|
||||
filter:Alpha(Opacity=35); /* For IE8 - See #6059 */
|
||||
}
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
.ui-icon,
|
||||
.ui-widget-content .ui-icon {
|
||||
background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/;
|
||||
}
|
||||
.ui-widget-header .ui-icon {
|
||||
background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/;
|
||||
}
|
||||
.ui-state-default .ui-icon {
|
||||
background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/;
|
||||
}
|
||||
.ui-state-hover .ui-icon,
|
||||
.ui-state-focus .ui-icon {
|
||||
background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/;
|
||||
}
|
||||
.ui-state-active .ui-icon {
|
||||
background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/;
|
||||
}
|
||||
.ui-state-highlight .ui-icon {
|
||||
background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/;
|
||||
}
|
||||
.ui-state-error .ui-icon,
|
||||
.ui-state-error-text .ui-icon {
|
||||
background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/;
|
||||
}
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-blank { background-position: 16px 16px; }
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-all,
|
||||
.ui-corner-top,
|
||||
.ui-corner-left,
|
||||
.ui-corner-tl {
|
||||
border-top-left-radius: 4px/*{cornerRadius}*/;
|
||||
}
|
||||
.ui-corner-all,
|
||||
.ui-corner-top,
|
||||
.ui-corner-right,
|
||||
.ui-corner-tr {
|
||||
border-top-right-radius: 4px/*{cornerRadius}*/;
|
||||
}
|
||||
.ui-corner-all,
|
||||
.ui-corner-bottom,
|
||||
.ui-corner-left,
|
||||
.ui-corner-bl {
|
||||
border-bottom-left-radius: 4px/*{cornerRadius}*/;
|
||||
}
|
||||
.ui-corner-all,
|
||||
.ui-corner-bottom,
|
||||
.ui-corner-right,
|
||||
.ui-corner-br {
|
||||
border-bottom-right-radius: 4px/*{cornerRadius}*/;
|
||||
}
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay {
|
||||
background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/;
|
||||
opacity: .3/*{opacityOverlay}*/;
|
||||
filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/;
|
||||
}
|
||||
.ui-widget-shadow {
|
||||
margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/;
|
||||
padding: 8px/*{thicknessShadow}*/;
|
||||
background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/;
|
||||
opacity: .3/*{opacityShadow}*/;
|
||||
filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/;
|
||||
border-radius: 8px/*{cornerRadiusShadow}*/;
|
||||
}
|
||||
25
templates/admin/default/assets/less/thelia/logger.less
Normal file
25
templates/admin/default/assets/less/thelia/logger.less
Normal file
@@ -0,0 +1,25 @@
|
||||
.logger{
|
||||
margin: 20px 0px 20px 0px;
|
||||
padding: 15px;
|
||||
height: 400px;
|
||||
overflow: scroll;
|
||||
background-color: #000000;
|
||||
color: #ffffff;
|
||||
ul#logger-content{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
li.entry{
|
||||
list-style-type: none;
|
||||
span.head {
|
||||
color: #9acd32;
|
||||
font-weight: bold;
|
||||
}
|
||||
span.data {
|
||||
}
|
||||
}
|
||||
li.no-entry{
|
||||
list-style-type: none;
|
||||
color: #ff0000;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
@import "bootstrap-select.less";
|
||||
@import "jqplot.less";
|
||||
@import "dropzone.less";
|
||||
@import "logger.less";
|
||||
|
||||
// -- Base styling ------------------------------------------------------------
|
||||
|
||||
@@ -295,6 +296,14 @@
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.loading-block{
|
||||
background: url("@{imgDir}/ajax-loader.gif") no-repeat;
|
||||
margin: auto;
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.modal-backdrop .loading {
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
|
||||
@@ -153,19 +153,19 @@
|
||||
|
||||
{loop type="auth" name="pcc6" role="ADMIN" resource="admin.configuration.mailing-system" access="VIEW"}
|
||||
<tr>
|
||||
<td><a href="{url path='/admin/configuration/mailing_system'}">{intl l='Mailing system'}</a></td>
|
||||
<td><a href="{url path='/admin/configuration/mailingSystem'}">{intl l='Mailing system'}</a></td>
|
||||
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/mailingSystem'}"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{* {loop type="auth" name="pcc7" role="ADMIN" resource="admin.configuration.admin-logs" access="VIEW"}
|
||||
{loop type="auth" name="pcc7" role="ADMIN" resource="admin.configuration.admin-logs" access="VIEW"}
|
||||
<tr>
|
||||
<td><a href="{url path='/admin/configuration/admin_logs'}">{intl l='Administration logs'}</a></td>
|
||||
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/admin_logs'}"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
<td><a href="{url path='/admin/configuration/adminLogs'}">{intl l='Administration logs'}</a></td>
|
||||
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/adminLogs'}"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="pcc8" role="ADMIN" resource="admin.configuration.system-logs" access="VIEW"}
|
||||
{* {loop type="auth" name="pcc8" role="ADMIN" resource="admin.configuration.system-logs" access="VIEW"}
|
||||
<tr>
|
||||
<td><a href="{url path='/admin/configuration/system_logs'}">{intl l='System logs'}</a></td>
|
||||
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/system_logs'}"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
|
||||
@@ -29,10 +29,6 @@
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
{javascripts file='assets/bootstrap-datepicker/js/bootstrap-datepicker.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
@@ -63,10 +59,6 @@
|
||||
filemanager_title:"{intl l='Files manager'}" ,
|
||||
external_plugins: { "filemanager" : "{url file='/tinymce/plugins/filemanager/plugin.min.js'}"}
|
||||
});
|
||||
|
||||
$(function($){
|
||||
{*$('.datepicker').datepicker({ dateFormat: "{$dateFormat}", defaultDate: +60, minDate: "+0m" });*}
|
||||
});
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
{javascripts file='assets/bootstrap-datepicker/js/bootstrap-datepicker.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration/mailing_system'}">{intl l="Mailing system"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration/mailingSystem'}">{intl l="Mailing system"}</a></li>
|
||||
</ul>
|
||||
|
||||
{module_include location='mailing_system_top'}
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<div class="title title-without-tabs">{intl l="Configuration variables"}</div>
|
||||
<div class="title title-without-tabs">{intl l="Configuration mailing system"}</div>
|
||||
|
||||
{form name="thelia.admin.mailing-system.update"}
|
||||
|
||||
|
||||
@@ -14,16 +14,16 @@
|
||||
<figure class="item active">
|
||||
{images file='assets/img/carousel/slider1.png'}<img src="{$asset_url}" alt="img1">{/images}
|
||||
</figure>
|
||||
<figure class="item">
|
||||
{* <figure class="item">
|
||||
{images file='assets/img/carousel/slider2.png'}<img src="{$asset_url}" alt="img2">{/images}
|
||||
</figure>
|
||||
<figure class="item">
|
||||
{images file='assets/img/carousel/slider3.png'}<img src="{$asset_url}" alt="img3">{/images}
|
||||
</figure>
|
||||
</figure>*}
|
||||
</div>
|
||||
</div>
|
||||
<a class="left carousel-control" href="#carousel" data-slide="prev"><span class="icon-prev"></span></a>
|
||||
<a class="right carousel-control" href="#carousel" data-slide="next"><span class="icon-next"></span></a>
|
||||
{* <a class="left carousel-control" href="#carousel" data-slide="prev"><span class="icon-prev"></span></a>
|
||||
<a class="right carousel-control" href="#carousel" data-slide="next"><span class="icon-next"></span></a>*}
|
||||
</div>
|
||||
</section><!-- #carousel -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user