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 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'config-db/OpenSLX/ConfigDB.pm') 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: -- cgit v1.2.3-55-g7522