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
7cfc6271
Commit
7cfc6271
authored
Jan 07, 2021
by
Johan Cwiklinski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '9.5/bugfixes'
parents
3760040a
adfc9541
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
116 additions
and
36 deletions
+116
-36
ajax/entitytreesons.php
ajax/entitytreesons.php
+1
-1
inc/commonitilobject.class.php
inc/commonitilobject.class.php
+29
-7
inc/dashboard/provider.class.php
inc/dashboard/provider.class.php
+5
-4
inc/html.class.php
inc/html.class.php
+1
-1
inc/item_ticket.class.php
inc/item_ticket.class.php
+1
-1
inc/ticket.class.php
inc/ticket.class.php
+3
-22
tests/emails-tests/20-attachement-rfc5987-singleline.eml
tests/emails-tests/20-attachement-rfc5987-singleline.eml
+74
-0
tests/imap/MailCollector.php
tests/imap/MailCollector.php
+2
-0
No files found.
ajax/entitytreesons.php
View file @
7cfc6271
...
...
@@ -78,7 +78,7 @@ if (isset($_GET['node'])) {
$nodes
[]
=
$path
;
}
}
else
{
// standard node
$node_id
=
$_GET
[
'node'
]
;
$node_id
=
preg_replace
(
'/r$/'
,
''
,
$_GET
[
'node'
])
;
$iterator
=
$DB
->
request
([
'SELECT'
=>
[
'ent.id'
,
...
...
inc/commonitilobject.class.php
View file @
7cfc6271
...
...
@@ -3326,13 +3326,7 @@ abstract class CommonITILObject extends CommonDBTM {
'name'
=>
__
(
'Time to resolve exceedeed'
),
'datatype'
=>
'bool'
,
'massiveaction'
=>
false
,
'computation'
=>
'IF('
.
$DB
->
quoteName
(
'TABLE.time_to_resolve'
)
.
' IS NOT NULL
AND '
.
$DB
->
quoteName
(
'TABLE.status'
)
.
' <> 4
AND ('
.
$DB
->
quoteName
(
'TABLE.solvedate'
)
.
' > '
.
$DB
->
quoteName
(
'TABLE.time_to_resolve'
)
.
'
OR ('
.
$DB
->
quoteName
(
'TABLE.solvedate'
)
.
' IS NULL
AND '
.
$DB
->
quoteName
(
'TABLE.time_to_resolve'
)
.
' < NOW())),
1, 0)'
'computation'
=>
self
::
generateSLAOLAComputation
(
'time_to_resolve'
)
];
$tab
[]
=
[
...
...
@@ -3789,6 +3783,34 @@ abstract class CommonITILObject extends CommonDBTM {
return
$tab
;
}
static
function
generateSLAOLAComputation
(
$type
,
$table
=
"TABLE"
)
{
global
$DB
;
switch
(
$type
)
{
case
'internal_time_to_own'
:
case
'time_to_own'
:
return
'IF('
.
$DB
->
quoteName
(
$table
.
'.'
.
$type
)
.
' IS NOT NULL
AND '
.
$DB
->
quoteName
(
$table
.
'.status'
)
.
' <> '
.
self
::
WAITING
.
'
AND ('
.
$DB
->
quoteName
(
$table
.
'.takeintoaccount_delay_stat'
)
.
'
> TIME_TO_SEC(TIMEDIFF('
.
$DB
->
quoteName
(
$table
.
'.'
.
$type
)
.
',
'
.
$DB
->
quoteName
(
$table
.
'.date'
)
.
'))
OR ('
.
$DB
->
quoteName
(
$table
.
'.takeintoaccount_delay_stat'
)
.
' = 0
AND '
.
$DB
->
quoteName
(
$table
.
'.'
.
$type
)
.
' < NOW())),
1, 0)'
;
break
;
case
'internal_time_to_resolve'
:
case
'time_to_resolve'
:
return
'IF('
.
$DB
->
quoteName
(
$table
.
'.'
.
$type
)
.
' IS NOT NULL
AND '
.
$DB
->
quoteName
(
$table
.
'.status'
)
.
' <> 4
AND ('
.
$DB
->
quoteName
(
$table
.
'.solvedate'
)
.
' > '
.
$DB
->
quoteName
(
$table
.
'.'
.
$type
)
.
'
OR ('
.
$DB
->
quoteName
(
$table
.
'.solvedate'
)
.
' IS NULL
AND '
.
$DB
->
quoteName
(
$table
.
'.'
.
$type
)
.
' < NOW())),
1, 0)'
;
break
;
}
}
/**
* Get status icon
*
...
...
inc/dashboard/provider.class.php
View file @
7cfc6271
...
...
@@ -39,6 +39,7 @@ use CommonITILActor;
use
CommonITILValidation
;
use
CommonTreeDropdown
;
use
DBConnection
;
use
CommonITILObject
;
use
Group
;
use
Group_Ticket
;
use
Problem
;
...
...
@@ -269,10 +270,10 @@ class Provider extends CommonGLPI {
$query_criteria
[
'WHERE'
]
+=
[
"
$table
.status"
=>
Ticket
::
getNotSolvedStatusArray
(),
'OR'
=>
[
'time_to_resolve'
=>
[
'<'
,
new
QueryExpression
(
'NOW()'
)]
,
'time_to_own'
=>
[
'<'
,
new
QueryExpression
(
'NOW()'
)]
,
'internal_time_to_own'
=>
[
'<'
,
new
QueryExpression
(
'NOW()'
)]
,
'internal_time_to_resolve'
=>
[
'<'
,
new
QueryExpression
(
'NOW()'
)]
,
CommonITILObject
::
generateSLAOLAComputation
(
'time_to_resolve'
,
'glpi_tickets'
)
,
CommonITILObject
::
generateSLAOLAComputation
(
'internal_time_to_resolve'
,
'glpi_tickets'
)
,
CommonITILObject
::
generateSLAOLAComputation
(
'time_to_own'
,
'glpi_tickets'
)
,
CommonITILObject
::
generateSLAOLAComputation
(
'internal_time_to_own'
,
'glpi_tickets'
)
,
]
];
break
;
...
...
inc/html.class.php
View file @
7cfc6271
...
...
@@ -3886,7 +3886,7 @@ JS;
// init editor
tinyMCE.init({
language_url: '
$language_url
',
invalid_elements: 'form,iframe,script,@[onclick|ondblclick|'
invalid_elements: 'form,
object,embed,
iframe,script,@[onclick|ondblclick|'
+ 'onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|'
+ 'onkeydown|onkeyup]',
browser_spellcheck: true,
...
...
inc/item_ticket.class.php
View file @
7cfc6271
...
...
@@ -672,7 +672,7 @@ class Item_Ticket extends CommonItilObject_Item {
'WHERE'
=>
[
'groups_id'
=>
$groups
]
+
getEntitiesRestrictCriteria
(
$itemtable
,
''
,
$entity_restrict
,
$item
->
maybeRecursive
()),
'ORDER'
=>
'name'
'ORDER'
=>
$item
->
getNameField
()
];
if
(
$item
->
maybeDeleted
())
{
...
...
inc/ticket.class.php
View file @
7cfc6271
...
...
@@ -2745,14 +2745,7 @@ class Ticket extends CommonITILObject {
'name'
=>
__
(
'Time to own exceedeed'
),
'datatype'
=>
'bool'
,
'massiveaction'
=>
false
,
'computation'
=>
'IF('
.
$DB
->
quoteName
(
'TABLE.time_to_own'
)
.
' IS NOT NULL
AND '
.
$DB
->
quoteName
(
'TABLE.status'
)
.
' <> '
.
self
::
WAITING
.
'
AND ('
.
$DB
->
quoteName
(
'TABLE.takeintoaccount_delay_stat'
)
.
'
> TIME_TO_SEC(TIMEDIFF('
.
$DB
->
quoteName
(
'TABLE.time_to_own'
)
.
',
'
.
$DB
->
quoteName
(
'TABLE.date'
)
.
'))
OR ('
.
$DB
->
quoteName
(
'TABLE.takeintoaccount_delay_stat'
)
.
' = 0
AND '
.
$DB
->
quoteName
(
'TABLE.time_to_own'
)
.
' < NOW())),
1, 0)'
'computation'
=>
self
::
generateSLAOLAComputation
(
'time_to_own'
)
];
$tab
[]
=
[
...
...
@@ -2783,12 +2776,7 @@ class Ticket extends CommonITILObject {
'name'
=>
__
(
'Internal time to resolve exceedeed'
),
'datatype'
=>
'bool'
,
'massiveaction'
=>
false
,
'computation'
=>
'IF('
.
$DB
->
quoteName
(
'TABLE.internal_time_to_resolve'
)
.
' IS NOT NULL
AND '
.
$DB
->
quoteName
(
'TABLE.status'
)
.
' <> 4
AND ('
.
$DB
->
quoteName
(
'TABLE.solvedate'
)
.
' > '
.
$DB
->
quoteName
(
'TABLE.internal_time_to_resolve'
)
.
'
OR ('
.
$DB
->
quoteName
(
'TABLE.solvedate'
)
.
' IS NULL
AND '
.
$DB
->
quoteName
(
'TABLE.internal_time_to_resolve'
)
.
' < NOW())),
1, 0)'
'computation'
=>
self
::
generateSLAOLAComputation
(
'internal_time_to_resolve'
)
];
$tab
[]
=
[
...
...
@@ -2819,14 +2807,7 @@ class Ticket extends CommonITILObject {
'name'
=>
__
(
'Internal time to own exceedeed'
),
'datatype'
=>
'bool'
,
'massiveaction'
=>
false
,
'computation'
=>
'IF('
.
$DB
->
quoteName
(
'TABLE.internal_time_to_own'
)
.
' IS NOT NULL
AND '
.
$DB
->
quoteName
(
'TABLE.status'
)
.
' <> '
.
self
::
WAITING
.
'
AND ('
.
$DB
->
quoteName
(
'TABLE.takeintoaccount_delay_stat'
)
.
'
> TIME_TO_SEC(TIMEDIFF('
.
$DB
->
quoteName
(
'TABLE.internal_time_to_own'
)
.
',
'
.
$DB
->
quoteName
(
'TABLE.date'
)
.
'))
OR ('
.
$DB
->
quoteName
(
'TABLE.takeintoaccount_delay_stat'
)
.
' = 0
AND '
.
$DB
->
quoteName
(
'TABLE.internal_time_to_own'
)
.
' < NOW())),
1, 0)'
'computation'
=>
self
::
generateSLAOLAComputation
(
'internal_time_to_own'
)
];
$max_date
=
'99999999'
;
...
...
tests/emails-tests/20-attachement-rfc5987-singleline.eml
0 → 100644
View file @
7cfc6271
Return-Path
:
normal@glpi-project.org
Received
:
from 192.168.1.3 (LHLO mail.glpi-project.org) (192.168.1.3)
by mail.glpi-project.org with LMTP; Thu, 7 Jun 2018 12:05:51 +0200
(CEST)
Received
:
from mail.glpi-project.org (localhost [127.0.0.1])
by mail.glpi-project.org (Postfix) with ESMTP id 6E50A7E807FE
for <unittests@glpi-project.org>; Thu, 7 Jun 2018 12:05:51 +0200 (CEST)
Received
:
from localhost (localhost [127.0.0.1])
by mail.glpi-project.org (Postfix) with ESMTP id 5C15F7E80423
for <unittests@glpi-project.org>; Thu, 7 Jun 2018 12:05:51 +0200 (CEST)
Received
:
from mail.glpi-project.org ([127.0.0.1])
by localhost (mail.glpi-project.org [127.0.0.1]) (amavisd-new, port 10026)
with ESMTP id zZ35QyFtsE9R for <unittests@glpi-project.org>;
Thu, 7 Jun 2018 12:05:51 +0200 (CEST)
Received
:
from mail.glpi-project.org (localhost [127.0.0.1])
by mail.glpi-project.org (Postfix) with ESMTP id 214627E807E8
for <unittests@glpi-project.org>; Thu, 7 Jun 2018 12:05:51 +0200 (CEST)
Date
:
Thu, 7 Jun 2018 12:05:51 +0200 (CEST)
From
:
Normal User <normal@glpi-project.org>
To
:
GLPI debug <unittests@glpi-project.org>
Message-ID
:
<1695134010.1757889.1528365951040.JavaMail.zimbra@glpi-project.org>
In-Reply-To
:
<1954034179.1757759.1528365914864.JavaMail.zimbra@glpi-project.org>
Subject
:
Attachement having filename using RFC5987 (single line)
MIME-Version
:
1.0
Content-Type
:
multipart/alternative;
boundary="----=_Part_1757883_1359581901.1528365951028"
------=_Part_1757883_1359581901.1528365951028
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Attached image has special chars in its filename
------=_Part_1757883_1359581901.1528365951028
Content-Type: multipart/related;
boundary="----=_Part_1757884_1267006027.1528365951028"
------=_Part_1757884_1267006027.1528365951028
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<html>
<body>
Attached image has special chars in its filename
<img src="cid:6f1f48de7c56cc3412e74008ad9f7c640091f5e3@zimbra">
</body>
</html>
------=_Part_1757884_1267006027.1528365951028
Content-Type: image/gif;
name="=?UTF-8?B?MjAtc3BlYyVDMyVBRmFsJTIwY2hhcnMuZ2lm?="
Content-Disposition: attachment;
filename*=UTF-8''20-spec%C3%AFal%20chars.gif
Content-Transfer-Encoding: base64
Content-ID: <6f1f48de7c56cc3412e74008ad9f7c640091f5e3@zimbra>
R0lGODlhBQAFAIcAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAA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 @@ class MailCollector extends DbTestCase {
'This is a mail without subject.'
,
// No subject = name is set using ticket contents
'Image tag splitted on multiple lines'
,
'Attachement having filename using RFC5987 (multiple lines)'
,
'Attachement having filename using RFC5987 (single line)'
,
'Mono-part HTML message'
,
]
],
...
...
@@ -399,6 +400,7 @@ class MailCollector extends DbTestCase {
'15-image001.png'
,
'18-blank.gif'
,
'19-ʂǷèɕɩɐɫ ȼɦâʁȿ.gif'
,
'20-specïal chars.gif'
,
];
$iterator
=
$DB
->
request
(
...
...
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