Commit e5eaeb79 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(interface): activate sorting in snapshot list

Snapshot list can now be sorted if needed

issue #5708
Showing with 23 additions and 2 deletions
+23 -2
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<script src="include/controls.js" type="text/javascript"></script> <script src="include/controls.js" type="text/javascript"></script>
<script src="include/pulldown.js" type="text/javascript"></script> <script src="include/pulldown.js" type="text/javascript"></script>
<script src="include/datepicker.js" type="text/javascript"></script> <script src="include/datepicker.js" type="text/javascript"></script>
<script src="include/tsorter.js" type="text/javascript"></script>
{/if} {/if}
<script src="include/tsorter.js" type="text/javascript"></script>
{foreach from=$js_files item=file} {foreach from=$js_files item=file}
<script src="{$file}" type="text/javascript"></script> <script src="{$file}" type="text/javascript"></script>
{/foreach} {/foreach}
......
...@@ -85,6 +85,27 @@ class SnapshotsAttribute extends OrderedArrayAttribute ...@@ -85,6 +85,27 @@ class SnapshotsAttribute extends OrderedArrayAttribute
$this->setInLdap(FALSE); $this->setInLdap(FALSE);
} }
function setParent (&$plugin)
{
parent::setParent($plugin);
if (is_object($this->plugin)) {
if ($this->plugin->global) {
$this->setHeaders(array(
_('DN'),
_('Date'),
_('Description'),
''
));
} else {
$this->setHeaders(array(
_('Date'),
_('Description'),
''
));
}
}
}
function loadPostValue () function loadPostValue ()
{ {
if ($this->isVisible()) { if ($this->isVisible()) {
...@@ -193,10 +214,10 @@ class SnapshotRestoreDialog extends simplePlugin ...@@ -193,10 +214,10 @@ class SnapshotRestoreDialog extends simplePlugin
function __construct ($dn, $parent, $global, $aclCategory) function __construct ($dn, $parent, $global, $aclCategory)
{ {
$this->global = $global;
parent::__construct(); parent::__construct();
$this->object_dn = $dn; $this->object_dn = $dn;
$this->parent = $parent; $this->parent = $parent;
$this->global = $global;
$this->aclCategory = $aclCategory; $this->aclCategory = $aclCategory;
if ($this->global) { if ($this->global) {
$this->attributesAccess['object_dn']->setVisible(FALSE); $this->attributesAccess['object_dn']->setVisible(FALSE);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment