Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
glpi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
GLPI
glpi
Commits
121238a8
Commit
121238a8
authored
Jan 12, 2021
by
Johan Cwiklinski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '9.5/bugfixes'
parents
7b0cb0ed
fca1a4a2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
32 deletions
+57
-32
CHANGELOG.md
CHANGELOG.md
+4
-0
inc/commonglpi.class.php
inc/commonglpi.class.php
+10
-0
inc/console/migration/timestampscommand.class.php
inc/console/migration/timestampscommand.class.php
+1
-0
inc/dashboard/filter.class.php
inc/dashboard/filter.class.php
+1
-2
inc/dashboard/provider.class.php
inc/dashboard/provider.class.php
+35
-28
inc/dbmysql.class.php
inc/dbmysql.class.php
+6
-2
No files found.
CHANGELOG.md
View file @
121238a8
...
...
@@ -95,6 +95,10 @@ The present file will list all changes made to the project; according to the
-
`Reservation::displayReservationDay()`
-
`Reservation::displayReservationsForAnItem()`
## [9.5.3] 2020-11-25
### Deprecated
-
Usage of alternative DB connection encoding (
`DB::$dbenc`
property).
## [9.5.2] 2020-10-07
...
...
inc/commonglpi.class.php
View file @
121238a8
...
...
@@ -1192,6 +1192,16 @@ class CommonGLPI {
function
display
(
$options
=
[])
{
global
$CFG_GLPI
;
// Init active tab to main if not defined
if
(
!
isset
(
$_SESSION
[
'glpi_tabs'
][
self
::
getType
()]))
{
// TODO: use array_key_first when php 7.3 is supported
$tabs
=
array_keys
(
$this
->
defineTabs
());
$first_tab
=
array_shift
(
$tabs
);
if
(
$first_tab
)
{
Session
::
setActiveTab
(
self
::
getType
(),
$first_tab
);
}
}
if
(
isset
(
$options
[
'id'
])
&&
!
$this
->
isNewID
(
$options
[
'id'
]))
{
if
(
!
$this
->
getFromDB
(
$options
[
'id'
]))
{
...
...
inc/console/migration/timestampscommand.class.php
View file @
121238a8
...
...
@@ -71,6 +71,7 @@ class TimestampsCommand extends AbstractCommand {
],
'WHERE'
=>
[
'information_schema.columns.table_schema'
=>
$this
->
db
->
dbdefault
,
'information_schema.columns.table_name'
=>
[
'LIKE'
,
'glpi_%'
],
'information_schema.columns.data_type'
=>
'datetime'
],
'ORDER'
=>
[
...
...
inc/dashboard/filter.class.php
View file @
121238a8
...
...
@@ -150,7 +150,7 @@ JAVASCRIPT;
}
static
function
group_tech
(
string
$value
=
"0"
):
string
{
return
self
::
dropdown
(
$value
,
'group_tech'
,
Group
::
class
);
return
self
::
dropdown
(
$value
,
'group_tech'
,
Group
::
class
,
[
'toadd'
=>
[
-
1
=>
__
(
"My groups"
)]]
);
}
static
function
user_tech
(
string
$value
=
"0"
):
string
{
...
...
@@ -195,7 +195,6 @@ JAVASCRIPT;
return
$js
.
self
::
field
(
$fieldname
,
$field
,
$label
,
$value
>
0
);
}
/**
* Get generic HTML for a filter
*
...
...
inc/dashboard/provider.class.php
View file @
121238a8
...
...
@@ -1290,36 +1290,44 @@ class Provider extends CommonGLPI {
];
}
if
(
isset
(
$apply_filters
[
'group_tech'
])
&&
(
int
)
$apply_filters
[
'group_tech'
]
>
0
)
{
if
(
isset
(
$apply_filters
[
'group_tech'
]))
{
if
(
$DB
->
fieldExists
(
$table
,
'groups_id_tech'
))
{
$where
+=
[
"
$table
.groups_id_tech"
=>
(
int
)
$apply_filters
[
'group_tech'
]
];
}
else
if
(
in_array
(
$table
,
[
Ticket
::
getTable
(),
Change
::
getTable
(),
Problem
::
getTable
(),
]))
{
$itemtype
=
getItemTypeForTable
(
$table
);
$main_item
=
getItemForItemtype
(
$itemtype
);
$grouplink
=
$main_item
->
grouplinkclass
;
$gl_table
=
$grouplink
::
getTable
();
$fk
=
$main_item
->
getForeignKeyField
();
$groups_id
=
null
;
if
((
int
)
$apply_filters
[
'group_tech'
]
>
0
)
{
$groups_id
=
(
int
)
$apply_filters
[
'group_tech'
];
}
else
if
((
int
)
$apply_filters
[
'group_tech'
]
==
-
1
)
{
$groups_id
=
$_SESSION
[
'glpigroups'
];
}
$join
+=
[
"
$gl_table
as gl"
=>
[
'ON'
=>
[
'gl'
=>
$fk
,
$table
=>
'id'
,
if
(
$groups_id
!=
null
)
{
if
(
$DB
->
fieldExists
(
$table
,
'groups_id_tech'
))
{
$where
+=
[
"
$table
.groups_id_tech"
=>
$groups_id
];
}
else
if
(
in_array
(
$table
,
[
Ticket
::
getTable
(),
Change
::
getTable
(),
Problem
::
getTable
(),
]))
{
$itemtype
=
getItemTypeForTable
(
$table
);
$main_item
=
getItemForItemtype
(
$itemtype
);
$grouplink
=
$main_item
->
grouplinkclass
;
$gl_table
=
$grouplink
::
getTable
();
$fk
=
$main_item
->
getForeignKeyField
();
$join
+=
[
"
$gl_table
as gl"
=>
[
'ON'
=>
[
'gl'
=>
$fk
,
$table
=>
'id'
,
]
]
]
];
$where
+=
[
"gl.type"
=>
\
CommonITILActor
::
ASSIGN
,
"gl.groups_id"
=>
(
int
)
$apply_filters
[
'group_tech'
]
];
]
;
$where
+=
[
"gl.type"
=>
\
CommonITILActor
::
ASSIGN
,
"gl.groups_id"
=>
$groups_id
];
}
}
}
...
...
@@ -1367,7 +1375,6 @@ class Provider extends CommonGLPI {
return
$criteria
;
}
private
static
function
getDatesCriteria
(
string
$field
=
""
,
array
$dates
=
[]):
array
{
$begin
=
strtotime
(
$dates
[
0
]);
$end
=
strtotime
(
$dates
[
1
]);
...
...
inc/dbmysql.class.php
View file @
121238a8
...
...
@@ -198,6 +198,9 @@ class DBmysql {
$this
->
connected
=
false
;
$this
->
error
=
2
;
}
else
{
if
(
isset
(
$this
->
dbenc
))
{
Toolbox
::
deprecated
(
'Usage of alternative DB connection encoding (`DB::$dbenc` property) is deprecated.'
);
}
$dbenc
=
isset
(
$this
->
dbenc
)
?
$this
->
dbenc
:
"utf8"
;
$this
->
dbh
->
set_charset
(
$dbenc
);
if
(
$dbenc
===
"utf8"
)
{
...
...
@@ -1467,8 +1470,9 @@ class DBmysql {
'COUNT'
=>
'cpt'
,
'FROM'
=>
'information_schema.columns'
,
'WHERE'
=>
[
'information_schema.columns.table_schema'
=>
$DB
->
dbdefault
,
'information_schema.columns.data_type'
=>
[
'datetime'
]
'information_schema.columns.table_schema'
=>
$DB
->
dbdefault
,
'information_schema.columns.table_name'
=>
[
'LIKE'
,
'glpi_%'
],
'information_schema.columns.data_type'
=>
[
'datetime'
]
]
])
->
next
();
return
(
int
)
$result
[
'cpt'
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment