Files
PrestaShop/controllers/admin/AdminLogsController.php
Kevin Granger 67dc7aac04 Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap
Conflicts:
	admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form_ranges.tpl
	admin-dev/themes/default/template/controllers/groups/helpers/view/view.tpl
	admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl
	admin-dev/themes/default/template/controllers/modules/filters.tpl
	admin-dev/themes/default/template/controllers/modules/list.tpl
	admin-dev/themes/default/template/controllers/orders/form.tpl
	admin-dev/themes/default/template/helpers/form/form.tpl
	classes/Category.php
	classes/controller/AdminController.php
	controllers/admin/AdminAttributesGroupsController.php
	controllers/admin/AdminFeaturesController.php
	controllers/admin/AdminImportController.php
	controllers/admin/AdminLogsController.php
	install-dev/install_version.php
	install-dev/langs/ru/data/tab.xml
	js/admin_carrier_wizard.js
	modules/loyalty/loyalty.php
2013-10-14 12:21:29 +02:00

87 lines
3.1 KiB
PHP

<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
class AdminLogsControllerCore extends AdminController
{
public function __construct()
{
$this->bootstrap = true;
$this->table = 'log';
$this->className = 'Logger';
$this->lang = false;
$this->noLink = true;
$this->fields_list = array(
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'havingFilter' => true),
'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'message' => array('title' => $this->l('Message')),
'object_type' => array('title' => $this->l('Object type'), 'class' => 'fixed-width-sm'),
'object_id' => array('title' => $this->l('Object ID'), 'align' => 'center', 'class' => 'fixed-width-xs'),
'error_code' => array('title' => $this->l('Error code'), 'align' => 'center', 'prefix' => '0x', 'class' => 'fixed-width-xs'),
'date_add' => array('title' => $this->l('Date'), 'width' => 150, 'align' => 'right', 'type' => 'datetime')
);
$this->fields_options = array(
'general' => array(
'title' => $this->l('Logs by email'),
'icon' => 'icon-envelope',
'fields' => array(
'PS_LOGS_BY_EMAIL' => array(
'title' => $this->l('Minimum severity level'),
'hint' => $this->l('Enter "5" if you do not want to receive any emails.').'<br />'.$this->l('Emails will be sent to the shop owner.'),
'cast' => 'intval',
'type' => 'text'
)
),
'submit' => array()
)
);
$this->list_no_link = true;
$this->_select .= 'CONCAT(LEFT(e.firstname, 1), \'. \', e.lastname) employee';
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'employee e ON (a.id_employee = e.id_employee)';
parent::__construct();
}
public function processDelete()
{
return Logger::eraseAllLogs();
}
public function initToolbar()
{
parent::initToolbar();
$this->toolbar_btn['delete'] = array(
'short' => 'Erase',
'desc' => $this->l('Erase all'),
'js' => 'if (confirm(\''.$this->l('Are you sure?').'\')) document.location = \''.$this->context->link->getAdminLink('AdminLogs').'&amp;token='.$this->token.'&deletelog=1\';'
);
unset($this->toolbar_btn['new']);
}
}
?>