Make owner appendix optional for categories

This commit is contained in:
Jörg Lehrke 2009-12-07 16:15:39 +00:00
parent 83a61a8766
commit 459941bd84
8 changed files with 48 additions and 20 deletions

View File

@ -231,12 +231,15 @@
if ($this->appname && $cat['app_name'] == 'phpgw') if ($this->appname && $cat['app_name'] == 'phpgw')
{ {
$appendix = '<' . lang('Global') . '>'; $appendix = ' ♦';
} }
elseif ($cat['owner'] != $accountId) elseif ($cat['owner'] != $accountId)
{
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{ {
$appendix = ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>'; $appendix = ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
} }
}
else else
{ {
$appendix = ''; $appendix = '';

View File

@ -194,9 +194,12 @@
$s .= ' ♦'; $s .= ' ♦';
} }
elseif ($cat['owner'] != $accountId) elseif ($cat['owner'] != $accountId)
{
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{ {
$s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>'; $s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
} }
}
elseif ($cat['access'] == 'private') elseif ($cat['access'] == 'private')
{ {
$s .= ' ♥'; $s .= ' ♥';

View File

@ -94,9 +94,12 @@ class tree_widget
$s .= ' ♦'; $s .= ' ♦';
} }
elseif ($cat['owner'] != $accountId) elseif ($cat['owner'] != $accountId)
{
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{ {
$s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>'; $s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
} }
}
elseif ($cat['access'] == 'private') { elseif ($cat['access'] == 'private') {
$s .= ' ♥'; $s .= ' ♥';
} }

View File

@ -342,9 +342,12 @@ class infolog_hooks
$s .= ' ♦'; $s .= ' ♦';
} }
elseif ($cat['owner'] != $accountId) elseif ($cat['owner'] != $accountId)
{
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{ {
$s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>'; $s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
} }
}
elseif ($cat['access'] == 'private') elseif ($cat['access'] == 'private')
{ {
$s .= ' ♥'; $s .= ' ♥';

View File

@ -404,9 +404,12 @@ class categories
$s .= ' ♦'; $s .= ' ♦';
} }
elseif ($cat['owner'] != $this->account_id) elseif ($cat['owner'] != $this->account_id)
{
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{ {
$s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>'; $s .= ' <' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '>';
} }
}
elseif ($cat['access'] == 'private') elseif ($cat['access'] == 'private')
{ {
$s .= ' ♥'; $s .= ' ♥';

View File

@ -216,22 +216,22 @@
$GLOBALS['egw']->template->set_var('color',$gray < 128 ? 'style="color: white;"' : ''); $GLOBALS['egw']->template->set_var('color',$gray < 128 ? 'style="color: white;"' : '');
$accountId = $GLOBALS['egw_info']['user']['account_id']; $accountId = $GLOBALS['egw_info']['user']['account_id'];
$appendix = '';
if ($GLOBALS['egw_info']['user']['preferences']['common']['show_category_owner'])
{
if ($cat['app_name'] == 'phpgw') if ($cat['app_name'] == 'phpgw')
{ {
$appendix = '&lt;' . lang('Global') . '&gt;'; $appendix = ' &#9830;';
} }
elseif ($cat['owner'] == '-1') elseif ($cat['owner'] == '-1')
{ {
$appendix = '&lt;' . lang('Global') . '&nbsp;' . $GLOBALS['egw_info']['apps'][$cats_app]['title'] . '&gt;'; $appendix = ' &#9830;&nbsp;' . $GLOBALS['egw_info']['apps'][$cats_app]['title'];
} }
elseif ($cat['owner'] != $accountId) elseif ($cat['owner'] != $accountId)
{ {
$appendix = ' &lt;' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '&gt;'; $appendix = ' &lt;' . $GLOBALS['egw']->accounts->id2name($cat['owner'], 'account_fullname') . '&gt;';
} }
else
{
$appendix = '';
} }
$level = $cat['level']; $level = $cat['level'];

View File

@ -316,6 +316,18 @@
'xmlrpc' => True, 'xmlrpc' => True,
'admin' => false, 'admin' => false,
), ),
'show_category_owner' => array(
'type' => 'select',
'label' => 'Show the category owner with the category name.',
'name' => 'show_category_owner',
'values' => array(
'1' => lang('Yes'),
'0' => lang('No'),
),
'help' => 'The owner is attached to distinguish between categories with the same name. You can turn this off and will get the names only.',
'xmlrpc' => True,
'admin' => False
),
); );
// disable thumbnails, if no size configured by admin // disable thumbnails, if no size configured by admin
if (!$GLOBALS['egw_info']['server']['link_list_thumbnail']) unset($GLOBALS['settings']['link_list_thumbnail']); if (!$GLOBALS['egw_info']['server']['link_list_thumbnail']) unset($GLOBALS['settings']['link_list_thumbnail']);

View File

@ -17,6 +17,7 @@ require_once 'Horde/RPC.php';
$GLOBALS['egw_info'] = array( $GLOBALS['egw_info'] = array(
'flags' => array( 'flags' => array(
'currentapp' => 'login', 'currentapp' => 'login',
'login' => True,
'noheader' => True, 'noheader' => True,
'nonavbar' => True, 'nonavbar' => True,
'disable_Template_class' => True 'disable_Template_class' => True