Feature #34772 ยป belog-extbase-1.diff
t3lib/class.t3lib_bedisplaylog.php | ||
---|---|---|
* @package TYPO3
|
||
* @subpackage t3lib
|
||
* @see tx_belog_webinfo, SC_mod_tools_log_index
|
||
* @deprecated and unused since TYPO3 4.8, will be removed two versions later
|
||
*/
|
||
class t3lib_BEDisplayLog {
|
||
var $lastTimeLabel = '';
|
||
... | ... | |
var $be_user_Array = array(); // Username array (set externally)
|
||
/**
|
||
* Default constructor logs deprecation
|
||
*/
|
||
public function __construct() {
|
||
t3lib_div::logDeprecatedFunction();
|
||
}
|
||
/**
|
||
* Initialize the log table array with header labels.
|
||
*
|
||
* @return array
|
t3lib/stddb/tables.php | ||
---|---|---|
);
|
||
/**
|
||
* Table "sys_history":
|
||
* Holds history records, the config part is defined in t3lib/stddb/tbl_be.php
|
||
*/
|
||
$TCA['sys_history'] = array(
|
||
'ctrl' => array(
|
||
'title' => 'LLL:EXT:lang/locallang_tca.xlf:sys_history',
|
||
'label' => 'tablename',
|
||
'tstamp' => 'tstamp',
|
||
'adminOnly' => TRUE,
|
||
'rootLevel' => TRUE,
|
||
'hideTable' => TRUE,
|
||
'default_sortby' => 'uid DESC',
|
||
'dynamicConfigFile' => 'T3LIB:tbl_be.php',
|
||
),
|
||
);
|
||
/**
|
||
* Table "sys_languages":
|
||
* Defines possible languages used for translation of records in the system
|
||
* This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
|
||
... | ... | |
)
|
||
);
|
||
/**
|
||
* Table "sys_log":
|
||
* Holds log records, the config part is defined in t3lib/stddb/tbl_be.php
|
||
*/
|
||
$TCA['sys_log'] = array(
|
||
'ctrl' => array(
|
||
'title' => 'LLL:EXT:lang/locallang_tca.xlf:sys_log',
|
||
'label' => 'details',
|
||
'tstamp' => 'tstamp',
|
||
'adminOnly' => TRUE,
|
||
'rootLevel' => TRUE,
|
||
'hideTable' => TRUE,
|
||
'default_sortby' => 'uid DESC',
|
||
'dynamicConfigFile' => 'T3LIB:tbl_be.php',
|
||
),
|
||
);
|
||
/**
|
||
* Table "sys_news":
|
t3lib/stddb/tables.sql | ||
---|---|---|
#
|
||
CREATE TABLE sys_history (
|
||
uid int(11) unsigned NOT NULL auto_increment,
|
||
pid int(11) unsigned DEFAULT '0' NOT NULL,
|
||
sys_log_uid int(11) DEFAULT '0' NOT NULL,
|
||
history_data mediumtext,
|
||
fieldlist text,
|
||
... | ... | |
history_files mediumtext,
|
||
snapshot tinyint(4) DEFAULT '0' NOT NULL,
|
||
PRIMARY KEY (uid),
|
||
KEY parent (pid),
|
||
KEY recordident_1 (tablename,recuid),
|
||
KEY recordident_2 (tablename,tstamp),
|
||
KEY sys_log_uid (sys_log_uid)
|
||
... | ... | |
#
|
||
CREATE TABLE sys_log (
|
||
uid int(11) unsigned NOT NULL auto_increment,
|
||
pid int(11) unsigned DEFAULT '0' NOT NULL,
|
||
userid int(11) unsigned DEFAULT '0' NOT NULL,
|
||
action tinyint(4) unsigned DEFAULT '0' NOT NULL,
|
||
recuid int(11) unsigned DEFAULT '0' NOT NULL,
|
||
... | ... | |
workspace int(11) DEFAULT '0' NOT NULL,
|
||
NEWid varchar(20) DEFAULT '' NOT NULL,
|
||
PRIMARY KEY (uid),
|
||
KEY parent (pid),
|
||
KEY event (userid,event_pid),
|
||
KEY recuidIdx (recuid,uid),
|
||
KEY user_auth (type,action,tstamp)
|
t3lib/stddb/tbl_be.php | ||
---|---|---|
);
|
||
/**
|
||
* System Log
|
||
*/
|
||
$TCA['sys_history'] = array(
|
||
'ctrl' => $TCA['sys_history']['ctrl'],
|
||
'columns' => array(
|
||
'sys_log_uid' => array(
|
||
'label' => 'sys_log_uid',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'history_data' => array(
|
||
'label' => 'history_data',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'fieldlist' => array(
|
||
'label' => 'fieldlist',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'recuid' => array(
|
||
'label' => 'recuid',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'tablename' => array(
|
||
'label' => 'tablename',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'tstamp' => array(
|
||
'label' => 'tstamp',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'history_files' => array(
|
||
'label' => 'history_files',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'snapshot' => array(
|
||
'label' => 'snapshot',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
),
|
||
'types' => array(
|
||
'1' => array(
|
||
'showitem' => 'sys_log_uid, history_data, fieldlist, recuid, tablename, tstamp, history_files, snapshot',
|
||
),
|
||
),
|
||
);
|
||
/**
|
||
* System languages - Defines possible languages used for translation of records in the system
|
||
*/
|
||
$TCA['sys_language'] = array(
|
||
... | ... | |
)
|
||
);
|
||
/**
|
||
* System Log
|
||
*/
|
||
$TCA['sys_log'] = array(
|
||
'ctrl' => $TCA['sys_log']['ctrl'],
|
||
'columns' => array(
|
||
'tstamp' => array(
|
||
'label' => 'tstamp',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'userid' => array(
|
||
'label' => 'userid',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'action' => array(
|
||
'label' => 'action',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'recuid' => array(
|
||
'label' => 'recuid',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'tablename' => array(
|
||
'label' => 'tablename',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'recpid' => array(
|
||
'label' => 'recpid',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'error' => array(
|
||
'label' => 'error',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'details' => array(
|
||
'label' => 'details',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'type' => array(
|
||
'label' => 'type',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'detail_nr' => array(
|
||
'label' => 'detail_nr',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'IP' => array(
|
||
'label' => 'IP',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'log_data' => array(
|
||
'label' => 'log_data',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'event_pid' => array(
|
||
'label' => 'event_pid',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'workspace' => array(
|
||
'label' => 'workspace',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
'NEWid' => array(
|
||
'label' => 'NEWid',
|
||
'config' => array(
|
||
'type' => 'input',
|
||
),
|
||
),
|
||
),
|
||
'types' => array(
|
||
'1' => array(
|
||
'showitem' => 'tstamp, userid, action, recuid, tablename, recpid, error, details, type, details_nr, IP, log_data, event_pid, workspace, NEWid',
|
||
),
|
||
),
|
||
);
|
||
/**
|
||
* System News (displayed on Login screen)
|
typo3/sysext/belog/Classes/Controller/AbstractController.php | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
* This script 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.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Abstract class to show log entries from sys_log
|
||
*
|
||
* @author Christian Kuhn <lolli@schwarzbu.ch>
|
||
* @package TYPO3
|
||
* @subpackage belog
|
||
*/
|
||
abstract class Tx_Belog_Controller_AbstractController extends Tx_Extbase_MVC_Controller_ActionController {
|
||
/**
|
||
* @var Tx_Belog_Domain_Repository_SysLogRepository
|
||
*/
|
||
protected $sysLogRepository;
|
||
/**
|
||
* Inject sys log repository
|
||
*
|
||
* @param Tx_Belog_Domain_Repository_SysLogRepository $sysLogRepository
|
||
* @return void
|
||
*/
|
||
public function injectSysLogRepository(Tx_Belog_Domain_Repository_SysLogRepository $sysLogRepository) {
|
||
$this->sysLogRepository = $sysLogRepository;
|
||
}
|
||
/**
|
||
* Initialize index action
|
||
*
|
||
* @return void
|
||
*/
|
||
public function initializeIndexAction() {
|
||
if (!isset($this->settings['dateFormat'])) {
|
||
$this->settings['dateFormat'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'];
|
||
}
|
||
if (!isset($this->settings['timeFormat'])) {
|
||
$this->settings['timeFormat'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'];
|
||
}
|
||
// @TODO: If some idiot clicks manual date, but does not choose a valid date, an exception is thrown that should be handled
|
||
$this->configurePropertyMapperForDateTimeFormat($this->arguments['constraint']->getPropertyMappingConfiguration()->forProperty('manualDateStart'));
|
||
$this->configurePropertyMapperForDateTimeFormat($this->arguments['constraint']->getPropertyMappingConfiguration()->forProperty('manualDateStop'));
|
||
}
|
||
/**
|
||
* Show general information and the installed modules
|
||
*
|
||
* @param Tx_Belog_Domain_Model_Constraint $constraint
|
||
* @return void
|
||
*/
|
||
public function indexAction(Tx_Belog_Domain_Model_Constraint $constraint = NULL) {
|
||
// Constraint object handling:
|
||
// If there is none from GET, try to get it from BE user data, else create new
|
||
if (!$constraint instanceof Tx_Belog_Domain_Model_Constraint) {
|
||
$constraint = $this->getConstraintObjectFromBeUserData();
|
||
if (!$constraint) {
|
||
$constraint = $this->objectManager->get('Tx_Belog_Domain_Model_Constraint');
|
||
}
|
||
} else {
|
||
$this->persistConstraintObjectInBeUserData($constraint);
|
||
}
|
||
$constraint = $this->forceWorkspaceSelectionIfInWorkspace($constraint);
|
||
debug($this->settings);
|
||
$logEntries = $this->sysLogRepository->findByConstraint($constraint);
|
||
$groupedLogEntries = $this->groupLogEntriesByPageAndDay($logEntries);
|
||
$this->view
|
||
->assign('groupedLogEntries', $groupedLogEntries)
|
||
->assign('constraint', $constraint)
|
||
->assign('userGroupList', $this->createUserAndGroupListForSelectOptions())
|
||
->assign('workspaceList', $this->createWorkspaceListForSelectOptions())
|
||
;
|
||
}
|
||
/**
|
||
* Get module states (the constraint object) from user data
|
||
*
|
||
* @return mixed Valid Tx_Belog_Domain_Model_Constraint object, or FALSE
|
||
*/
|
||
protected function getConstraintObjectFromBeUserData() {
|
||
$serializedConstraintObject = $GLOBALS['BE_USER']->getModuleData(get_class($this));
|
||
$constraintObject = NULL;
|
||
if (strlen($serializedConstraintObject) > 0) {
|
||
$constraintObject = @unserialize($serializedConstraintObject);
|
||
}
|
||
if ($constraintObject instanceof Tx_Belog_Domain_Model_Constraint) {
|
||
return $constraintObject;
|
||
} else {
|
||
return FALSE;
|
||
}
|
||
}
|
||
/**
|
||
* Save current constraint object in be user settings (uC)
|
||
*
|
||
* @param Tx_Belog_Domain_Model_Constraint $constraint
|
||
* @return void
|
||
*/
|
||
protected function persistConstraintObjectInBeUserData(Tx_Belog_Domain_Model_Constraint $constraint) {
|
||
$GLOBALS['BE_USER']->pushModuleData(get_class($this), serialize($constraint));
|
||
}
|
||
/**
|
||
* Create a sorted array for day and page view from
|
||
* the query result of the sys log repository
|
||
*
|
||
* [pid]['path'] = '/page1/subPage1'
|
||
* [pid]['days'][12345]['entries']
|
||
* [pid]['days'][23456]['entries']
|
||
*
|
||
* @param Tx_Extbase_Persistence_QueryResult<Tx_Belog_Domain_Model_LogEntry> $logEntries
|
||
* @return array
|
||
*/
|
||
protected function groupLogEntriesByPageAndDay(Tx_Extbase_Persistence_QueryResult $logEntries) {
|
||
$targetStructure = array();
|
||
/** @var $entry Tx_Belog_Domain_Model_SysLog */
|
||
foreach ($logEntries as $entry) {
|
||
$pid = $entry->getEventPid();
|
||
if (!is_array($targetStructure[$pid])) {
|
||
$targetStructure[$pid] = array(
|
||
'path' => 'a path',
|
||
'days' => array(),
|
||
);
|
||
}
|
||
$timestampDay = strtotime(strftime('%d.%m.%Y', $entry->getTstamp()));
|
||
if (!is_array($targetStructure[$pid]['days'][$timestampDay])) {
|
||
$targetStructure[$pid]['days'][$timestampDay] = array(
|
||
'logItems' => array(),
|
||
);
|
||
}
|
||
$targetStructure[$pid]['days'][$timestampDay]['logItems'][] = $entry;
|
||
}
|
||
return $targetStructure;
|
||
}
|
||
/**
|
||
* Configure the property mapper to expect date strings in configured BE format
|
||
*
|
||
* @param Tx_Extbase_Property_PropertyMappingConfiguration $propertyMapperDate
|
||
* @return void
|
||
*/
|
||
protected function configurePropertyMapperForDateTimeFormat(Tx_Extbase_Property_PropertyMappingConfiguration $propertyMapperDate) {
|
||
$propertyMapperDate->setTypeConverterOption(
|
||
'Tx_Extbase_Property_TypeConverter_DateTimeConverter',
|
||
Tx_Extbase_Property_TypeConverter_DateTimeConverter::CONFIGURATION_DATE_FORMAT,
|
||
$this->settings['dateFormat'] . ' ' . $this->settings['timeFormat']
|
||
);
|
||
}
|
||
/**
|
||
* Create options for the user / group drop down.
|
||
* This is not moved to a repository by intention to not mix up this 'meta' data
|
||
* with real repository work
|
||
*
|
||
* @return array Key is the option name, value its label
|
||
*/
|
||
protected function createUserAndGroupListForSelectOptions() {
|
||
$userGroupArray = array();
|
||
// Two meta entries: 'all' and 'self'
|
||
$userGroupArray[0] = Tx_Extbase_Utility_Localization::translate('any', 'Belog');
|
||
$userGroupArray[-1] = Tx_Extbase_Utility_Localization::translate('self', 'Belog');
|
||
// List of groups, key is gr-'uid'
|
||
$groups = t3lib_BEfunc::getGroupNames();
|
||
foreach ($groups as $group) {
|
||
$userGroupArray['gr-' . $group['uid']] = Tx_Extbase_Utility_Localization::translate('group', 'Belog') . ' ' . $group['title'];
|
||
}
|
||
// List of users, key is us-'uid'
|
||
$users = t3lib_BEfunc::getUserNames();
|
||
foreach ($users as $user) {
|
||
$userGroupArray['us-' . $user['uid']] = Tx_Extbase_Utility_Localization::translate('user', 'Belog') . ' ' . $user['username'];
|
||
}
|
||
return $userGroupArray;
|
||
}
|
||
/**
|
||
* Create options for the workspace selector
|
||
*
|
||
* @return array Key is uid of workspace, value its label
|
||
*/
|
||
protected function createWorkspaceListForSelectOptions() {
|
||
$workspaceArray = array();
|
||
if (t3lib_extMgm::isLoaded('workspaces')) {
|
||
// Two meta entries: 'all' and 'live'
|
||
$workspaceArray[-99] = Tx_Extbase_Utility_Localization::translate('any', 'Belog');
|
||
$workspaceArray[0] = Tx_Extbase_Utility_Localization::translate('live', 'Belog');
|
||
$workspaces = $this->objectManager->get('Tx_Belog_Domain_Repository_WorkspaceRepository')->findAll();
|
||
/** @var $workspace Tx_Belog_Domain_Model_Workspace */
|
||
foreach ($workspaces as $workspace) {
|
||
$workspaceArray[$workspace->getUid()] = $workspace->getUid() . ': ' . $workspace->getTitle();
|
||
}
|
||
}
|
||
return $workspaceArray;
|
||
}
|
||
/**
|
||
* If the user is in a workspace different than LIVE,
|
||
* we force to show only log entries from the selected workspace,
|
||
* and the workspace selector is not shown.
|
||
*
|
||
* @param Tx_Belog_Domain_Model_Constraint $constraint
|
||
* @return Tx_Belog_Domain_Model_Constraint
|
||
*/
|
||
protected function forceWorkspaceSelectionIfInWorkspace(Tx_Belog_Domain_Model_Constraint $constraint) {
|
||
if ($GLOBALS['BE_USER']->workspace !== 0) {
|
||
$constraint->setWorkspace($GLOBALS['BE_USER']->workspace);
|
||
$this->view->assign('showWorkspaceSelector', FALSE);
|
||
} else {
|
||
$this->view->assign('showWorkspaceSelector', TRUE);
|
||
}
|
||
return $constraint;
|
||
}
|
||
}
|
||
?>
|
typo3/sysext/belog/Classes/Controller/ToolsController.php | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
* This script 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.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Show log entries from table sys_log
|
||
*
|
||
* @author Christian Kuhn <lolli@schwarzbu.ch>
|
||
* @package TYPO3
|
||
* @subpackage belog
|
||
*/
|
||
class Tx_Belog_Controller_ToolsController extends Tx_Belog_Controller_AbstractController {
|
||
/**
|
||
* Set context to 'not in page mode'
|
||
*
|
||
* @param Tx_Belog_Domain_Model_Constraint $constraint
|
||
* @return void
|
||
*/
|
||
public function indexAction(Tx_Belog_Domain_Model_Constraint $constraint = NULL) {
|
||
$this->view->assign('isInPageContext', FALSE);
|
||
parent::indexAction($constraint);
|
||
}
|
||
}
|
||
?>
|
typo3/sysext/belog/Classes/Controller/WebInfoController.php | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
* This script 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.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Controller for log entry listings in Web->Info module
|
||
*
|
||
* @author Christian Kuhn <lolli@schwarzbu.ch>
|
||
* @package TYPO3
|
||
* @subpackage belog
|
||
*/
|
||
class Tx_Belog_Controller_WebInfoController extends Tx_Belog_Controller_AbstractController {
|
||
/**
|
||
* Set context to 'in page mode'
|
||
*
|
||
* @param Tx_Belog_Domain_Model_Constraint $constraint
|
||
* @return void
|
||
*/
|
||
public function indexAction(Tx_Belog_Domain_Model_Constraint $constraint = NULL) {
|
||
$this->view->assign('isInPageContext', TRUE);
|
||
parent::indexAction($constraint);
|
||
}
|
||
}
|
||
?>
|
typo3/sysext/belog/Classes/Domain/Model/BeUser.php | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
* This script 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.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Stub model for backend users - only properties required for belog module are added currently
|
||
*
|
||
* @author Christian Kuhn <lolli@schwarzbu.ch>
|
||
* @package TYPO3
|
||
* @subpackage belog
|
||
*/
|
||
class Tx_Belog_Domain_Model_BeUser extends Tx_Extbase_DomainObject_AbstractEntity {
|
||
/**
|
||
* @var string Name of the be_user
|
||
*/
|
||
protected $username;
|
||
/**
|
||
* Set workspace username
|
||
*
|
||
* @var string $username
|
||
* @return void
|
||
*/
|
||
public function setUsername($username) {
|
||
$this->username = $username;
|
||
}
|
||
/**
|
||
* Get workspace username
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getUsername() {
|
||
return $this->username;
|
||
}
|
||
}
|
||
?>
|
typo3/sysext/belog/Classes/Domain/Model/Constraint.php | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
* This script 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.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Constraints for log entries
|
||
*
|
||
* @author Christian Kuhn <lolli@schwarzbu.ch>
|
||
* @package TYPO3
|
||
* @subpackage belog
|
||
*/
|
||
class Tx_Belog_Domain_Model_Constraint extends Tx_Extbase_DomainObject_AbstractEntity {
|
||
/**
|
||
* @var string Selected user
|
||
*/
|
||
protected $user = 0;
|
||
/**
|
||
* @var integer Number of log rows to show
|
||
*/
|
||
protected $number = 20;
|
||
/**
|
||
* @var string Selected workspace
|
||
*/
|
||
protected $workspace = -99;
|
||
/**
|
||
* @var integer Selected time frame
|
||
*/
|
||
protected $timeFrame = 0;
|
||
/**
|
||
* @var integer Selected action
|
||
*/
|
||
protected $action = 0;
|
||
/**
|
||
* @var boolean Whether or not rows should be grouped by page
|
||
*/
|
||
protected $groupByPage = FALSE;
|
||
/**
|
||
* @var DateTime Manual date start
|
||
*/
|
||
protected $manualDateStart = NULL;
|
||
/**
|
||
* @var DateTime Manual date stop
|
||
*/
|
||
protected $manualDateStop = NULL;
|
||
/**
|
||
* Default constructor
|
||
*/
|
||
public function __construct() {
|
||
}
|
||
/**
|
||
* Set user
|
||
*
|
||
* @param string $user
|
||
* @return void
|
||
*/
|
||
public function setUser($user) {
|
||
$this->user = $user;
|
||
}
|
||
/**
|
||
* Get user
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getUser() {
|
||
return $this->user;
|
||
}
|
||
/**
|
||
* Set number of log rows to show
|
||
*
|
||
* @param integer $number
|
||
* @return void
|
||
*/
|
||
public function setNumber($number) {
|
||
$this->number = (int)$number;
|
||
}
|
||
/**
|
||
* Get number of log entries to show
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getNumber() {
|
||
return $this->number;
|
||
}
|
||
/**
|
||
* Set workspace
|
||
*
|
||
* @param string $workspace
|
||
* @return void
|
||
*/
|
||
public function setWorkspace($workspace) {
|
||
$this->workspace = $workspace;
|
||
}
|
||
/**
|
||
* Get workspace
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getWorkspace() {
|
||
return $this->workspace;
|
||
}
|
||
/**
|
||
* Set time frame
|
||
*
|
||
* @param integer $timeFrame
|
||
* @return void
|
||
*/
|
||
public function setTimeFrame($timeFrame) {
|
||
$this->timeFrame = (int)$timeFrame;
|
||
}
|
||
/**
|
||
* Get time frame
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getTimeFrame() {
|
||
return $this->timeFrame;
|
||
}
|
||
/**
|
||
* Set action
|
||
*
|
||
* @param integer $action
|
||
* @return void
|
||
*/
|
||
public function setAction($action) {
|
||
$this->action = (int)$action;
|
||
}
|
||
/**
|
||
* Get action
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getAction() {
|
||
return $this->action;
|
||
}
|
||
/**
|
||
* Set group by page
|
||
*
|
||
* @param boolean $groupByPage
|
||
* @return void
|
||
*/
|
||
public function setGroupByPage($groupByPage) {
|
||
$this->groupByPage = (boolean)$groupByPage;
|
||
}
|
||
/**
|
||
* Get group by page
|
||
*
|
||
* @return bool
|
||
*/
|
||
public function getGroupByPage() {
|
||
return $this->groupByPage;
|
||
}
|
||
/**
|
||
* Set manual date start
|
||
*
|
||
* @param DateTime $manualDateStart
|
||
* @return void
|
||
*/
|
||
public function setManualDateStart(DateTime $manualDateStart) {
|
||
$this->manualDateStart = $manualDateStart;
|
||
}
|
||
/**
|
||
* Get manual date start
|
||
*
|
||
* @return DateTime
|
||
*/
|
||
public function getManualDateStart() {
|
||
return $this->manualDateStart;
|
||
}
|
||
/**
|
||
* Set manual date stop
|
||
*
|
||
* @param DateTime $manualDateStop
|
||
* @return void
|
||
*/
|
||
public function setManualDateStop(DateTime $manualDateStop) {
|
||
$this->manualDateStop = $manualDateStop;
|
||
}
|
||
/**
|
||
* Get manual date stop
|
||
*
|
||
* @return DateTime
|
||
*/
|
||
public function getManualDateStop() {
|
||
return $this->manualDateStop;
|
||
}
|
||
}
|
||
?>
|
typo3/sysext/belog/Classes/Domain/Model/SysHistory.php | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
* This script 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.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* Stub model for sys history - only properties required for belog module are added currently
|
||
*
|
||
* @author Christian Kuhn <lolli@schwarzbu.ch>
|
||
* @package TYPO3
|
||
* @subpackage belog
|
||
*/
|
||
class Tx_Belog_Domain_Model_SysHistory extends Tx_Extbase_DomainObject_AbstractEntity {
|
||
/**
|
||
* @var string List of changed fields
|
||
*/
|
||
protected $fieldlist;
|
||
/**
|
||
* Set list of changed fields
|
||
*
|
||
* @var string $fieldlist
|
||
* @return void
|
||
*/
|
||
public function setFieldlist($fieldlist) {
|
||
$this->fieldlist = $fieldlist;
|
||
}
|
||
/**
|
||
* Get field list
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getFieldlist() {
|
||
return $this->fieldlist;
|
||
}
|
||
}
|
||
?>
|
typo3/sysext/belog/Classes/Domain/Model/SysLog.php | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
* This script 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.
|
||
*
|
||
* This copyright notice MUST APPEAR in all copies of the script!
|
||
***************************************************************/
|
||
/**
|
||
* A sys log entry
|
||
* This model is 'complete': All current database properties are in there.
|
||
* @TODO: This should be stuffed to some more central place
|
||
*
|
||
* @author Christian Kuhn <lolli@schwarzbu.ch>
|
||
* @package TYPO3
|
||
* @subpackage belog
|
||
*/
|
||
class Tx_Belog_Domain_Model_SysLog extends Tx_Extbase_DomainObject_AbstractEntity {
|
||
/**
|
||
* @var integer Storage page id of the log entry
|
||
*/
|
||
protected $pid;
|
||
/**
|
||
* This is not a relation to BeUser model, since the user does
|
||
* not always exist, but we want the uid in then anyway.
|
||
* This case is ugly in extbase, the best way we
|
||
* have found now is to resolve the username (if it exists) in a
|
||
* view helper and just use the uid of the be user here.
|
||
*
|
||
* @var int
|
||
*/
|
||
protected $beUserUid;
|
||
/**
|
||
* @var int action Id of the action that happened: For example '3' was a file action
|
||
*/
|
||
protected $action;
|
||
/**
|
||
* @var int Uid of the record the event happened to
|
||
*/
|
||
protected $recordUid;
|
||
/**
|
||
* @var string table name
|
||
*/
|
||
protected $tableName;
|
||
/**
|
||
* @var int Pid of the record the event happened to
|
||
*/
|
||
protected $recordPid;
|
||
/**
|
||
* @var int Error
|
||
*/
|
||
protected $error;
|
||
/**
|
||
* @var string Details This is the log message itself, but possibly with %s substitutions
|
||
*/
|
||
protected $details;
|
||
/**
|
||
* @var int Timestamp when the log entry was written
|
||
*/
|
||
protected $tstamp;
|
||
/**
|
||
* @var int Type
|
||
*/
|
||
protected $type;
|
||
/**
|
||
* @var int Details number
|
||
*/
|
||
protected $detailsNumber;
|
||
/**
|
||
* @var string Ip address of client
|
||
*/
|
||
protected $ip;
|
||
/**
|
||
* @var string Serialized log data This is a serialized array with substitutions for $this->details
|
||
*/
|
||
protected $logData;
|
||
/**
|
||
* @var int event pid
|
||
*/
|
||
protected $eventPid;
|
||
/**
|
||
* This is only the uid and not the full workspace object for
|
||
* the same reason as in $beUserUid
|
||
*
|
||
* @var integer
|
||
*/
|
||
protected $workspaceUid;
|
||
/**
|
||
* @var string new id
|
||
*/
|
||
protected $newId;
|
||
/**
|
||
* Set pid
|
||
*
|
||
* @param int $pid
|
||
* @return void
|
||
*/
|
||
public function setPid($pid) {
|
||
$this->pid = (int)$pid;
|
||
}
|
||
/**
|
||
* Get pid
|
||
*
|
||
* @return integer
|
||
*/
|
||
public function getPid() {
|
||
return $this->pid;
|
||
}
|
||
/**
|
||
* Set backend user uid
|
||
*
|
||
* @param integer $beUserUid
|
||
* @return void
|
||
*/
|
||
public function setBeUserUid($beUserUid) {
|
||
$this->beUserUid = $beUserUid;
|
||
}
|
||
/**
|
||
* Get backend user id
|
||
*
|
||
* @return integer
|
||
*/
|
||
public function getBeUserUid() {
|
||
return $this->beUserUid;
|
||
}
|
||
/**
|
||
* Set action
|
||
*
|
||
* @param int $action
|
||
* @return void
|
||
*/
|
||
public function setAction($action) {
|
||
$this->action = (int)$action;
|
||
}
|
||
/**
|
||
* Get action
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getAction() {
|
||
return $this->action;
|
||
}
|
||
/**
|
||
* Set record uid
|
||
*
|
||
* @param int $recordUid
|
||
* @return void
|
||
*/
|
||
public function setRecordUid($recordUid) {
|
||
$this->recordUid = $recordUid;
|
||
}
|
||
/**
|
||
* Get record uid
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getRecordUid() {
|
||
return $this->recordUid;
|
||
}
|
||
/**
|
||
* Set table name
|
||
*
|
||
* @param string $tableName
|
||
* @return void
|
||
*/
|
||
public function setTableName($tableName) {
|
||
$this->tableName = $tableName;
|
||
}
|
||
/**
|
||
* Get table name
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getTableName() {
|
||
return $this->tableName;
|
||
}
|
||
/**
|
||
* Set record pid
|
||
*
|
||
* @param int $recordPid
|
||
* @return void
|
||
*/
|
||
public function setRecordPid($recordPid) {
|
||
$this->recordPid = $recordPid;
|
||
}
|
||
/**
|
||
* Get record pid
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getRecordPid() {
|
||
return $this->recordPid;
|
||
}
|
||
/**
|
||
* Set error
|
||
*
|
||
* @param int $error
|
||
* @return void
|
||
*/
|
||
public function setError($error) {
|
||
$this->error = (int)$error;
|
||
}
|
||
/**
|
||
* Get error
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getError() {
|
||
return $this->error;
|
||
}
|
||
/**
|
||
* Set details
|
||
*
|
||
* @param string $details
|
||
* @return void
|
||
*/
|
||
public function setDetails($details) {
|
||
$this->details = $details;
|
||
}
|
||
/**
|
||
* Get details
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getDetails() {
|
||
return $this->details;
|
||
}
|
||
/**
|
||
* Set tstamp
|
||
*
|
||
* @param int $tstamp
|
||
* @return void
|
||
*/
|
||
public function setTstamp($tstamp) {
|
||
$this->tstamp = $tstamp;
|
||
}
|
||
/**
|
||
* Get tstamp
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getTstamp() {
|
||
return $this->tstamp;
|
||
}
|
||
/**
|
||
* Set type
|
||
*
|
||
* @param int $type
|
||
* @return void
|
||
*/
|
||
public function setType($type) {
|
||
$this->type = (int)$type;
|
||
}
|
||
/**
|
||
* Get type
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getType() {
|
||
return $this->type;
|
||
}
|
||
/**
|
||
* Set details number
|
||
*
|
||
* @param int $detailsNumber
|
||
* @return void
|
||
*/
|
||
public function setDetailsNumber($detailsNumber) {
|
||
$this->detailsNumber = $detailsNumber;
|
||
}
|
||
/**
|
||
* Get details number
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getDetailsNumber() {
|
||
return $this->detailsNumber;
|
||
}
|
||
/**
|
||
* Set ip
|
||
*
|
||
* @param string $ip
|
||
* @return void
|
||
*/
|
||
public function setIp($ip) {
|
||
$this->ip = $ip;
|
||
}
|
||
/**
|
||
* Get ip
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getIp() {
|
||
return $this->ip;
|
||
}
|
||
/**
|
||
* Set log data
|
||
*
|
||
* @param string $logData
|
||
* @return void
|
||
*/
|
||
public function setLogData($logData) {
|
||
$this->logData = $logData;
|
||
}
|
||
/**
|
||
* Get log data
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getLogData() {
|
||
return @unserialize($this->logData);
|
||
}
|
||
/**
|
||
* Set event pid
|
||
*
|
||
* @param int $eventPid
|
||
* @return void
|
||
*/
|
||
public function setEventPid($eventPid) {
|
||
$this->eventPid = $eventPid;
|
||
}
|
||
/**
|
||
* Get event pid
|
||
*
|
||
* @return int
|
||
*/
|
||
public function getEventPid() {
|
||
return $this->eventPid;
|
||
}
|
||
/**
|
||
* Set workspace uid
|
||
*
|
||
* @param integer $workspace Uid
|
||
* @return void
|
||
*/
|
||
public function setWorkspaceUid($workspaceUid) {
|
||
$this->workspaceUid = $workspaceUid;
|
||
}
|
||
/**
|
||
* Get workspace
|
||
*
|
||
* @return integer
|
||
*/
|
||
public function getWorkspaceUid() {
|
||
return $this->workspaceUid;
|
||
}
|
||
/**
|
||
* Set new id
|
||
*
|
||
* @param string $newId
|
||
* @return void
|
||
*/
|
||
public function setNewId($newId) {
|
||
$this->newId = $newId;
|
||
}
|
||
/**
|
||
* Get new id
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getNewId() {
|
||
return $this->newId;
|
||
}
|
||
}
|
||
?>
|
typo3/sysext/belog/Classes/Domain/Model/Workspace.php | ||
---|---|---|
<?php
|
||
/***************************************************************
|
||
* Copyright notice
|
||
*
|
||
* (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
|
||
* All rights reserved
|
||
*
|
||
* This script is part of the TYPO3 project. The TYPO3 project 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 2 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* The GNU General Public License can be found at
|
||
* http://www.gnu.org/copyleft/gpl.html.
|
||
* A copy is found in the textfile GPL.txt and important notices to the license
|
||
* from the author is found in LICENSE.txt distributed with these scripts.
|
||
*
|
||
* This script is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|