From c2204abe5c2e03232763fbcabb6e47030120f884 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 29 Nov 2007 13:10:34 +0000 Subject: * changed meaning of groups.priority such that it corresponds with sorting order (0 means highest, 99 means lowest) * added method for getting the column names of a specific table git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1412 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/OpenSLX/ConfigDB.pm | 30 +++++++++++++++++++++++++++++- config-db/OpenSLX/DBSchema.pm | 2 +- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'config-db') diff --git a/config-db/OpenSLX/ConfigDB.pm b/config-db/OpenSLX/ConfigDB.pm index e286a4d7..0dfaffd7 100644 --- a/config-db/OpenSLX/ConfigDB.pm +++ b/config-db/OpenSLX/ConfigDB.pm @@ -257,6 +257,34 @@ sub rollbackTransaction =over +=cut + +=item C + +Returns the names of the columns of the given table. + +=over + +=item Param C + +The name of the DB-table whose columns you'd like to retrieve. + +=item Return Value + +An array of column names. + +=back + +=cut + +sub getColumnsOfTable +{ + my $self = shift; + my $tableName = shift; + + return map { (/^(\w+)\W/) ? $1 : $_; } @{$DbSchema->{tables}->{$tableName}}; +} + =item C Fetches and returns information about all vendor-OSes that match the given @@ -2070,7 +2098,7 @@ sub mergeDefaultAndGroupAttributesIntoClient # (ordered by priority from highest to lowest): my @groupIDs = $self->fetchGroupIDsOfClient($client->{id}); my @groups = - sort { $b->{priority} <=> $a->{priority} } + sort { $a->{priority} <=> $b->{priority} } $self->fetchGroupByID(\@groupIDs); foreach my $group (@groups) { # merge configuration from this group into the current client: diff --git a/config-db/OpenSLX/DBSchema.pm b/config-db/OpenSLX/DBSchema.pm index d22f6eab..81a68399 100644 --- a/config-db/OpenSLX/DBSchema.pm +++ b/config-db/OpenSLX/DBSchema.pm @@ -169,7 +169,7 @@ $DbSchema = { 'name:s.128', # name of group 'comment:s.1024', # internal comment (optional, for admins) 'priority:i', # priority, used for order in group-list - # (from 0-lowest to 10-highest) + # (from 0-highest to 99-lowest) @sharedAttributes, ], 'group_client_ref' => [ -- cgit v1.2.3-55-g7522