diff --git a/core/lib/Thelia/Controller/Admin/AdminLogsController.php b/core/lib/Thelia/Controller/Admin/AdminLogsController.php index 244baf747..1c7b6542f 100644 --- a/core/lib/Thelia/Controller/Admin/AdminLogsController.php +++ b/core/lib/Thelia/Controller/Admin/AdminLogsController.php @@ -41,12 +41,14 @@ class AdminLogsController extends BaseAdminController public function loadLoggerAjaxAction() { $entries = array(); + foreach( AdminLogQuery::getEntries( - $this->getRequest()->request->get('admins', array()), - null, - null, - array_merge($this->getRequest()->request->get('resources', array()), $this->getRequest()->request->get('modules', array())) - ) as $entry) { + $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( diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php index 93dbb6f86..76d9e1c66 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php @@ -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) diff --git a/core/lib/Thelia/Model/AdminLogQuery.php b/core/lib/Thelia/Model/AdminLogQuery.php index 8e9fb7eab..7113a4658 100755 --- a/core/lib/Thelia/Model/AdminLogQuery.php +++ b/core/lib/Thelia/Model/AdminLogQuery.php @@ -20,23 +20,25 @@ class AdminLogQuery extends BaseAdminLogQuery { /** * @param null $login - * @param \DateTime $maxDateTime - * @param \DateTime $minDateTime + * @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, \DateTime $maxDateTime = null, \DateTime $minDateTime = null, $resources = null, $actions = null) + public static function getEntries($login = null, $minDate = null, $maxDate = null, $resources = null, $actions = null) { $search = self::create(); - if(null !== $minDateTime) { - $search->filterByCreatedAt($minDateTime->getTimestamp(), Criteria::GREATER_EQUAL); + if(null !== $minDate) { + $search->filterByCreatedAt($minDate, Criteria::GREATER_EQUAL); } - if(null !== $maxDateTime) { - $search->filterByCreatedAt($maxDateTime->getTimestamp(), Criteria::LESS_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) { diff --git a/templates/admin/default/admin-logs.html b/templates/admin/default/admin-logs.html index 5acb35667..8f86729b7 100755 --- a/templates/admin/default/admin-logs.html +++ b/templates/admin/default/admin-logs.html @@ -24,16 +24,46 @@
{intl l="Administration logs"}
-
+
+
+ +
+
-
-
- -
+
+
+ {intl l='Period'} :
+
+
+
+ {intl l='From'} + + + + +
+
+
+
+ {intl l='To'} + + + + +
+
+
+
+ +
- Administrators : + {intl l='Administrators'} :
@@ -48,12 +78,11 @@
{/loop}
-
- Resources : + {intl l='Resources'} :
@@ -73,7 +102,7 @@
- Modules : + {intl l='Modules'} :
@@ -93,7 +122,7 @@
- +
@@ -116,9 +145,43 @@ {/javascripts} + {javascripts file='assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.js'} + + {/javascripts} + + {stylesheets file='assets/js/jquery.ui/jquery.ui.theme.css'} + + {/stylesheets} + {stylesheets file='assets/js/jquery.ui/jquery.ui.datepicker/jquery.ui.datepicker.css'} + + {/stylesheets} + + {javascripts file="assets/js/jquery/jquery.ui.ui.datepicker/i18n/jquery.ui.datepicker-{lang attr="locale"}.js" catchException="true"} + + {/javascripts} + + +