Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
fusiondirectory
Commits
ab19cc61
Commit
ab19cc61
authored
6 years ago
by
Côme Chilliet
Browse files
Options
Download
Patches
Plain Diff
feat(management) Add support for Unix Timestamp column
Used in alias plugin issue #5135
parent
6fd809e2
dev
6342-update-the-locales-for-1-5
6344-template-issue-when-creating-a-template-with-empty-password-error-message-should-not-be-seen
6365-core-locking-mechanism-is-not-changing-the-mail-ressource-it-does-lock-the-mail-account
6365-core-when-lock-mechanism-is-trigger-the-user-should-not-be-editable-if-not-unlock
6378-orcid-test-method-is-wrong-and-break-orcid-saving
core-php8
master
fusiondirectory-1.5
fusiondirectory-1.4
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/management/columns/class_LinkColumn.inc
+12
-7
include/management/columns/class_LinkColumn.inc
include/management/columns/class_UnixTimestampColumn.inc
+39
-0
include/management/columns/class_UnixTimestampColumn.inc
with
51 additions
and
7 deletions
+51
-7
include/management/columns/class_LinkColumn.inc
+
12
−
7
View file @
ab19cc61
...
...
@@ -29,15 +29,20 @@ class LinkColumn extends Column
if
(
$value
==
''
)
{
return
' '
;
}
else
{
if
(
$this
->
parent
->
parent
instanceof
selectManagement
)
{
if
(
$this
->
parent
->
getMultiSelect
())
{
return
'<label title="'
.
$entry
->
dn
.
'" for="listing_selected_'
.
$entry
->
row
.
'">'
.
htmlentities
(
$value
,
ENT_COMPAT
,
'UTF-8'
)
.
'</label>'
;
}
else
{
return
'<a href="?plug='
.
$_GET
[
'plug'
]
.
'&PID='
.
$entry
->
getPid
()
.
'&act=listing_select_'
.
$entry
->
row
.
'&add_finish=1" title="'
.
$entry
->
dn
.
'">'
.
htmlentities
(
$value
,
ENT_COMPAT
,
'UTF-8'
)
.
'</a>'
;
}
return
$this
->
renderLink
(
$entry
,
htmlentities
(
$value
,
ENT_COMPAT
,
'UTF-8'
));
}
}
protected
function
renderLink
(
ListingEntry
$entry
,
$htmlValue
)
{
if
(
$this
->
parent
->
parent
instanceof
selectManagement
)
{
if
(
$this
->
parent
->
getMultiSelect
())
{
return
'<label title="'
.
$entry
->
dn
.
'" for="listing_selected_'
.
$entry
->
row
.
'">'
.
$htmlValue
.
'</label>'
;
}
else
{
return
'<a href="?plug='
.
$_GET
[
'plug'
]
.
'&PID='
.
$entry
->
getPid
()
.
'&act=listing_
edi
t_'
.
$entry
->
row
.
'" title="'
.
$entry
->
dn
.
'">'
.
html
entities
(
$value
,
ENT_COMPAT
,
'UTF-8'
)
.
'</a>'
;
return
'<a href="?plug='
.
$_GET
[
'plug'
]
.
'&PID='
.
$entry
->
getPid
()
.
'&act=listing_
selec
t_'
.
$entry
->
row
.
'
&add_finish=1
" title="'
.
$entry
->
dn
.
'">'
.
$
html
Value
.
'</a>'
;
}
}
else
{
return
'<a href="?plug='
.
$_GET
[
'plug'
]
.
'&PID='
.
$entry
->
getPid
()
.
'&act=listing_edit_'
.
$entry
->
row
.
'" title="'
.
$entry
->
dn
.
'">'
.
$htmlValue
.
'</a>'
;
}
}
}
This diff is collapsed.
Click to expand it.
include/management/columns/class_UnixTimestampColumn.inc
0 → 100644
+
39
−
0
View file @
ab19cc61
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2018-2019 FusionDirectory
This program 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.
This program 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.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*!
* \brief Column rendering unix timestamp
*/
class
UnixTimestampColumn
extends
LinkColumn
{
protected
$type
=
'integer'
;
function
renderCell
(
ListingEntry
$entry
)
{
$value
=
$this
->
getAttributeValue
(
$entry
);
if
(
$value
!=
''
)
{
$dateObject
=
DateTime
::
createFromFormat
(
'U'
,
$value
,
new
DateTimeZone
(
'UTC'
));
if
(
is_object
(
$dateObject
))
{
return
$this
->
renderLink
(
$entry
,
$dateObject
->
format
(
'd.m.Y'
));
}
}
return
' '
;
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets