<?php


// USERS VISITS REPORT ////////////////////////////////////////////////////////////////////////////
$CFG['reportsManagement']['adminReport']['columnsList']['usersVisits']= [
	'id'=> ['type'=>'numeric', 'dbCol'=>"INT UNSIGNED NOT NULL AUTO_INCREMENT", 'disabled'=>true, 'cat'=>"visit"],
	'module'=> ['type'=>'string', 'dbCol'=>"VARCHAR(250) NOT NULL DEFAULT ''", 'cat'=>"visit"],
	'action'=> ['type'=>'string', 'dbCol'=>"VARCHAR(100) NOT NULL DEFAULT ''", 'cat'=>"visit"],
	'entityType'=> ['type'=>'string', 'dbCol'=>"VARCHAR(50) NOT NULL DEFAULT ''", 'cat'=>"visit"],
	'entityOperation'=> ['type'=>'string', 'dbCol'=>"VARCHAR(50) NOT NULL DEFAULT ''", 'cat'=>"visit"],
	'idEntity'=> ['type'=>'string', 'dbCol'=>"VARCHAR(50) NOT NULL DEFAULT ''", 'cat'=>"visit"],
	'extraData'=> ['type'=>'string', 'dbCol'=>"TEXT NOT NULL DEFAULT ''", 'cat'=>"visit", 'disabled'=>true],
	'extraDataList'=> ['type'=>'string', 'dbCol'=>"TEXT NOT NULL DEFAULT ''", 'cat'=>"visit"],
	'datetime'=> ['type'=>'datetime', 'dbCol'=>"DATETIME NOT NULL", 'cat'=>"visit"],
	'timestamp'=> ['type'=>'numeric', 'dbCol'=>"DECIMAL(16,6) UNSIGNED", 'cat'=>"visit"],

	'idUser'=> ['type'=>'numeric', 'dbCol'=>"SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 'cat'=>"user"],
	'userName'=> ['type'=>'string', 'dbCol'=>"VARCHAR(101) NOT NULL DEFAULT ''", 'cat'=>"user"],
	'userOfficeId'=> ['type'=>'numeric', 'dbCol'=>"SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 'cat'=>"user"],
	'userOfficeName'=> ['type'=>'string', 'dbCol'=>"VARCHAR(150) NOT NULL DEFAULT ''", 'cat'=>"user"],
	'userDepartmentId'=> ['type'=>'numeric', 'dbCol'=>"SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 'cat'=>"user"],
	'userDepartmentName'=> ['type'=>'string', 'dbCol'=>"VARCHAR(100) NOT NULL DEFAULT ''", 'cat'=>"user"],
	'userDepartmentCode'=> ['type'=>'string', 'dbCol'=>"VARCHAR(50) NOT NULL DEFAULT ''", 'cat'=>"user"],
	'activeUser'=> ['type'=>'boolean', 'dbCol'=>"TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'", 'cat'=>"user"],
];

// DATABASE FORCED COLUMNS ////////////////////////////////////////////////////////////////////////
$CFG['reportsManagement']['adminReport']['addForcedColumns']['usersVisits']= [
	'id', 'idUser', 'timestamp', 'userOfficeId'
];


// DATABASE COLUMNS DEPENDENCIES //////////////////////////////////////////////////////////////////
$CFG['reportsManagement']['adminReport']['columnsDependencies']['usersVisits']= [

	'userDepartmentName'=> ['userDepartmentId'],
	'userDepartmentCode'=> ['userDepartmentId'],

];


// TABLE PRIMARY KEY (can be more columns, separated by comma) ////////////////////////////////////
$CFG['reportsManagement']['adminReport']['tablePrimaryKey']['usersVisits']='`id`';


?>