Skip to content

Commit

Permalink
[jan] Always display system task lists to administrators.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jun 11, 2014
1 parent 51efe6c commit 8e214db
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions nag/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.3.0-git
----------

[jan] Always display system task lists to administrators.


-----------
Expand Down
17 changes: 16 additions & 1 deletion nag/lib/Application.php
Expand Up @@ -148,6 +148,19 @@ public function sidebar($sidebar)
'label' => _("Create a new Task List"),
);
}
if ($GLOBALS['registry']->isAdmin()) {
$sidebar->containers['system'] = array(
'header' => array(
'id' => 'nag-toggle-system',
'label' => _("System Task Lists"),
'collapsed' => true,
),
);
$sidebar->containers['system']['header']['add'] = array(
'url' => Horde::url('tasklists/create.php')->add('system', 1),
'label' => _("Create a new System Task List"),
);
}
$sidebar->containers['shared'] = array(
'header' => array(
'id' => 'nag-toggle-shared',
Expand All @@ -170,7 +183,9 @@ public function sidebar($sidebar)
'edit' => $edit->add('t', $tasklist->getName()),
'type' => 'checkbox',
);
if ($tasklist->get('owner') == $user) {
if (is_null($tasklist->get('owner'))) {
$sidebar->addRow($row, 'system');
} elseif ($tasklist->get('owner') == $user) {
$sidebar->addRow($row, 'my');
} else {
$sidebar->addRow($row, 'shared');
Expand Down
7 changes: 6 additions & 1 deletion nag/lib/Nag.php
Expand Up @@ -489,7 +489,12 @@ static public function listTasklists($owneronly = false,
array('perm' => $permission,
'attributes' => $att,
'sort_by' => 'name'));

if ($GLOBALS['registry']->isAdmin()) {
$tasklists = array_merge(
$tasklists,
$GLOBALS['nag_shares']->listSystemShares()
);
}
} catch (Horde_Share_Exception $e) {
Horde::log($e->getMessage(), 'ERR');
return array();
Expand Down
4 changes: 2 additions & 2 deletions nag/package.xml
Expand Up @@ -33,7 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
*
* [jan] Always display system task lists to administrators.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -1538,7 +1538,7 @@
<date>2014-06-04</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
*
* [jan] Always display system task lists to administrators.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 8e214db

Please sign in to comment.