From 83876f0709927b1ba4b6ae395a66d3b0b7829baa Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 1 Dec 2010 10:32:29 +0000 Subject: [PATCH] Updated info page git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20481 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/ihtml/themes/default/infoPage.tpl | 2 +- .../generic/infoPage/class_infoPage.inc | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/gosa-core/ihtml/themes/default/infoPage.tpl b/gosa-core/ihtml/themes/default/infoPage.tpl index 60dcd77bd..f7f0b77ed 100644 --- a/gosa-core/ihtml/themes/default/infoPage.tpl +++ b/gosa-core/ihtml/themes/default/infoPage.tpl @@ -50,7 +50,7 @@

{t}Administrative contact{/t}

{foreach from=$managers item=item} -
+
{$item.str}
{/foreach} diff --git a/gosa-core/plugins/generic/infoPage/class_infoPage.inc b/gosa-core/plugins/generic/infoPage/class_infoPage.inc index 01819bf19..ce958029f 100644 --- a/gosa-core/plugins/generic/infoPage/class_infoPage.inc +++ b/gosa-core/plugins/generic/infoPage/class_infoPage.inc @@ -87,15 +87,13 @@ class infoPage extends plugin // Get next department manager dn $dn = $this->dn; - $max = 10; - while(strlen($dn) >= strlen($this->config->current['BASE']) && $max){ + $max = 4; + while(strlen($dn) >= strlen($this->config->current['BASE']) && $max--){ $dn = preg_replace("/^[^,]+,/","",$dn); - $max --; $ldap->cat($dn, array('manager')); $attrs = $ldap->fetch(); if(isset($attrs['manager'][0])){ $dns['DEPARTMENT'] = $attrs['manager'][0]; - break; } } @@ -106,14 +104,14 @@ class infoPage extends plugin $managers[$dn] = $ldap->fetch(); $managers[$dn]['type'] = $type; $name = $phone = $mail = ""; - $name = "".set_post($managers[$dn]['sn'][0]).", ".set_post($managers[$dn]['givenName'][0]).""; - if(isset($managers[$dn]['mail'][0])){ - $mail = "
  • "._("Mail address").": ".set_post($managers[$dn]['mail'][0])."
  • "; - } + $name = "".set_post($managers[$dn]['givenName'][0])." ".set_post($managers[$dn]['sn'][0]).""; if(isset($managers[$dn]['telephoneNumber'][0])){ - $phone = "
  • "._("Phone number").": ".set_post($managers[$dn]['telephoneNumber'][0])."
  • "; + $phone = " "._("Phone number").":".set_post($managers[$dn]['telephoneNumber'][0]).""; + } + if(isset($managers[$dn]['mail'][0])){ + $mail = " "._("Mail").":".set_post($managers[$dn]['mail'][0]).""; } - $managers[$dn]['str'] = "

    {$name}

    "; + $managers[$dn]['str'] = "{$name}{$phone}{$mail}
    "; } return($managers); } -- 2.30.2