sort PDF output

This commit is contained in:
Roland Gruber 2014-07-17 19:34:51 +00:00
parent acfbd2fb6f
commit 02ddc9b427
2 changed files with 9 additions and 8 deletions

View File

@ -1843,9 +1843,14 @@ class posixAccount extends baseModule implements passwordService {
if ($this->get_scope() == 'host') { if ($this->get_scope() == 'host') {
$uidLabel = _('Host name'); $uidLabel = _('Host name');
} }
$additionalGroups = array();
if (!empty($this->groups)) {
$additionalGroups = $this->groups;
natcasesort($additionalGroups);
}
$return = array( $return = array(
'posixAccount_primaryGroup' => array('<block><key>' . _('Primary group') . '</key><value>' . $this->getGroupName($this->attributes['gidNumber'][0]) . '</value></block>'), 'posixAccount_primaryGroup' => array('<block><key>' . _('Primary group') . '</key><value>' . $this->getGroupName($this->attributes['gidNumber'][0]) . '</value></block>'),
'posixAccount_additionalGroups' => array('<block><key>' . _('Additional groups') . '</key><value>' . implode(", ", $this->groups) . '</value></block>'), 'posixAccount_additionalGroups' => array('<block><key>' . _('Additional groups') . '</key><value>' . implode(", ", $additionalGroups) . '</value></block>'),
); );
$this->addSimplePDFField($return, 'uid', $uidLabel); $this->addSimplePDFField($return, 'uid', $uidLabel);
$this->addSimplePDFField($return, 'cn', _('Common name')); $this->addSimplePDFField($return, 'cn', _('Common name'));
@ -1862,6 +1867,7 @@ class posixAccount extends baseModule implements passwordService {
$gons[] = $allGons[$this->gonList[$i]]['cn'][0]; $gons[] = $allGons[$this->gonList[$i]]['cn'][0];
} }
} }
natcasesort($gons);
$return['posixAccount_gon'] = array('<block><key>' . _('Groups of names') . '</key><value>' . implode(", ", $gons) . '</value></block>'); $return['posixAccount_gon'] = array('<block><key>' . _('Groups of names') . '</key><value>' . implode(", ", $gons) . '</value></block>');
} }
if (isset($this->clearTextPassword)) { if (isset($this->clearTextPassword)) {

View File

@ -565,13 +565,8 @@ class posixGroup extends baseModule implements passwordService {
* @return array list of possible PDF entries * @return array list of possible PDF entries
*/ */
function get_pdfEntries() { function get_pdfEntries() {
$members = ''; $return = array();
if (isset($this->attributes['memberUid'][0])) { $this->addSimplePDFField($return, 'memberUid', _('Group members'));
$members = implode(', ', $this->attributes['memberUid']);
}
$return = array(
get_class($this) . '_memberUid' => array('<block><key>' . _('Group members') . '</key><value>' . $members . '</value></block>'),
);
$this->addSimplePDFField($return, 'cn', _('Group name')); $this->addSimplePDFField($return, 'cn', _('Group name'));
$this->addSimplePDFField($return, 'gidNumber', _('GID number')); $this->addSimplePDFField($return, 'gidNumber', _('GID number'));
$this->addSimplePDFField($return, 'description', _('Description')); $this->addSimplePDFField($return, 'description', _('Description'));