Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GLPI
glpi
Commits
cb52e6e5
Commit
cb52e6e5
authored
Jun 18, 2019
by
Cédric Anne
Committed by
Johan Cwiklinski
Jul 09, 2019
Browse files
Fix transfered documents date in ITIL timeline and list view
parent
567cd32b
Changes
5
Hide whitespace changes
Inline
Side-by-side
inc/api.class.php
View file @
cb52e6e5
...
...
@@ -919,7 +919,7 @@ abstract class API extends CommonGLPI {
$doc_iterator
=
$DB
->
request
([
'SELECT'
=>
[
'glpi_documents_items.id AS assocID'
,
'glpi_documents_items.date_
mod
AS assocdate'
,
'glpi_documents_items.date_
creation
AS assocdate'
,
'glpi_entities.id AS entityID'
,
'glpi_entities.completename AS entity'
,
'glpi_documentcategories.completename AS headings'
,
...
...
inc/commonitilobject.class.php
View file @
cb52e6e5
...
...
@@ -6356,13 +6356,14 @@ abstract class CommonITILObject extends CommonDBTM {
$document_obj
->
getFromDB
(
$document_item
[
'documents_id'
]);
$item
=
$document_obj
->
fields
;
$item
[
'date'
]
=
$document_item
[
'date_creation'
];
// #1476 - set date_mod and owner to attachment ones
$item
[
'date_mod'
]
=
$document_item
[
'date_mod'
];
$item
[
'users_id'
]
=
$document_item
[
'users_id'
];
$item
[
'timeline_position'
]
=
$document_item
[
'timeline_position'
];
$timeline
[
$document_item
[
'date_
mod
'
]
.
"_document_"
.
$document_item
[
'documents_id'
]]
$timeline
[
$document_item
[
'date_
creation
'
]
.
"_document_"
.
$document_item
[
'documents_id'
]]
=
[
'type'
=>
'Document_Item'
,
'item'
=>
$item
];
}
...
...
inc/document_item.class.php
View file @
cb52e6e5
...
...
@@ -734,7 +734,7 @@ class Document_Item extends CommonDBRelation{
$criteria
=
[
'SELECT'
=>
[
'glpi_documents_items.id AS assocID'
,
'glpi_documents_items.date_
mod
AS assocdate'
,
'glpi_documents_items.date_
creation
AS assocdate'
,
'glpi_entities.id AS entityID'
,
'glpi_entities.completename AS entity'
,
'glpi_documentcategories.completename AS headings'
,
...
...
install/mysql/glpi-empty.sql
View file @
cb52e6e5
...
...
@@ -2752,10 +2752,12 @@ CREATE TABLE `glpi_documents_items` (
`date_mod`
timestamp
NULL
DEFAULT
NULL
,
`users_id`
int
(
11
)
DEFAULT
'0'
,
`timeline_position`
tinyint
(
1
)
NOT
NULL
DEFAULT
'0'
,
`date_creation`
datetime
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`unicity`
(
`documents_id`
,
`itemtype`
,
`items_id`
),
KEY
`item`
(
`itemtype`
,
`items_id`
,
`entities_id`
,
`is_recursive`
),
KEY
`users_id`
(
`users_id`
)
KEY
`users_id`
(
`users_id`
),
KEY
`date_creation`
(
`date_creation`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_unicode_ci
;
...
...
install/update_94_95.php
View file @
cb52e6e5
...
...
@@ -221,6 +221,7 @@ function update94to95() {
$ADDTODISPLAYPREF
[
'cluster'
]
=
[
31
,
19
];
/** /Clusters */
/** ITIL templates */
//rename tables
foreach
([
...
...
@@ -282,6 +283,25 @@ function update94to95() {
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"
;
$DB
->
queryOrDie
(
$query
,
"add table glpi_itilfollowuptemplates"
);
}
/** /add templates for followups */
/** Add "date_creation" field on document_items */
if
(
!
$DB
->
fieldExists
(
'glpi_documents_items'
,
'date_creation'
))
{
$migration
->
addField
(
'glpi_documents_items'
,
'date_creation'
,
'datetime'
);
$migration
->
addPostQuery
(
$DB
->
buildUpdate
(
'glpi_documents_items'
,
[
'date_creation'
=>
new
\
QueryExpression
(
$DB
->
quoteName
(
'date_mod'
)
)
],
[
true
]
)
);
$migration
->
addKey
(
'glpi_documents_items'
,
'date_creation'
);
}
/** /Add "date_creation" field on document_items */
// ************ Keep it at the end **************
foreach
(
$ADDTODISPLAYPREF
as
$type
=>
$tab
)
{
...
...
Write
Preview
Supports
Markdown
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