reduced PDF code

This commit is contained in:
Roland Gruber 2013-05-06 19:16:47 +00:00
parent 452901d687
commit a359e5432b
3 changed files with 11 additions and 29 deletions

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2004 - 2012 Roland Gruber Copyright (C) 2004 - 2013 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -621,10 +621,7 @@ class kolabUser extends baseModule {
*/ */
function get_pdfEntries() { function get_pdfEntries() {
$return = array(); $return = array();
// mail server $this->addSimplePDFField($return, 'mailHost', _('Mailbox home server'));
if (isset($this->attributes['mailHost'][0])) {
$return['kolabUser_mailHost'][0] = '<block><key>' . _('Mailbox home server') . '</key><value>' . $this->attributes['mailHost'][0] . '</value></block>';
}
// invitation policies // invitation policies
if (isset($this->attributes['kolabInvitationPolicy'][0])) { if (isset($this->attributes['kolabInvitationPolicy'][0])) {
// find default policy // find default policy
@ -643,14 +640,8 @@ class kolabUser extends baseModule {
} }
} }
} }
// email aliases $this->addSimplePDFField($return, 'aliases', _('Email aliases'), 'alias');
if (isset($this->attributes['alias'][0])) { $this->addSimplePDFField($return, 'delegate', _('Delegates'), 'kolabDelegate');
$return['kolabUser_aliases'][0] = '<block><key>' . _('Email aliases') . '</key><value>' . implode(", ", $this->attributes['alias']) . '</value></block>';
}
// delegates
if (isset($this->attributes['kolabDelegate'][0])) {
$return['kolabUser_delegate'][0] = '<block><key>' . _('Delegates') . '</key><value>' . implode(", ", $this->attributes['kolabDelegate']) . '</value></block>';
}
return $return; return $return;
} }

View File

@ -374,12 +374,8 @@ class nisMailAlias extends baseModule {
*/ */
function get_pdfEntries() { function get_pdfEntries() {
$return = array(); $return = array();
if (isset($this->attributes['cn'][0])) { $this->addSimplePDFField($return, 'alias', _('Alias name'), 'cn');
$return['nisMailAlias_alias'][0] = '<block><key>' . _('Alias name') . '</key><value>' . $this->attributes['cn'][0] . '</value></block>'; $this->addSimplePDFField($return, 'recipients', _('Recipient list'), 'rfc822MailMember');
}
if (sizeof($this->attributes['rfc822MailMember']) > 0) {
$return['nisMailAlias_recipients'][0] = '<block><key>' . _('Recipient list') . '</key><value>' . implode(', ', $this->attributes['rfc822MailMember']) . '</value></block>';
}
return $return; return $return;
} }

View File

@ -3,7 +3,7 @@
$Id$ $Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2009 - 2012 Roland Gruber Copyright (C) 2009 - 2013 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -571,16 +571,11 @@ class nisnetgroup extends baseModule {
*/ */
function get_pdfEntries() { function get_pdfEntries() {
$return = array(); $return = array();
// aliased entry $this->addSimplePDFField($return, 'cn', _('Group name'));
$return[get_class($this) . '_cn'] = array('<block><key>' . _('Group name') . '</key><value>' . $this->attributes['cn'][0] . '</value></block>'); $this->addSimplePDFField($return, 'description', _('Description'));
if (isset($this->attributes['description'][0])) { $this->addSimplePDFField($return, 'subgroups', _('Subgroups'), 'memberNisNetgroup');
$return[get_class($this) . '_description'] = array('<block><key>' . _('Description') . '</key><value>' . $this->attributes['description'][0] . '</value></block>');
}
if (is_array($this->attributes['memberNisNetgroup'])) {
$return[get_class($this) . '_subgroups'] = array('<block><key>' . _('Subgroups') . '</key><value>' . implode(', ', $this->attributes['memberNisNetgroup']) . '</value></block>');
}
if (sizeof($this->attributes['nisNetgroupTriple']) > 0) { if (sizeof($this->attributes['nisNetgroupTriple']) > 0) {
$return[get_class($this) . '_members'] = array('<block><key>' . _('Members') . '</key><value> </value></block>'); $return[get_class($this) . '_members'] = array('<block><tr><td width="80%"><b>' . _('Members') . '</b></td></tr></block>');
$return[get_class($this) . '_members'][] = '<block><tr>' . $return[get_class($this) . '_members'][] = '<block><tr>' .
'<td width="20%"><b>' . _('Host') . '</b></td>' . '<td width="20%"><b>' . _('Host') . '</b></td>' .
'<td width="20%"><b>' . _('User') . '</b></td>' . '<td width="20%"><b>' . _('User') . '</b></td>' .