diff options
-rw-r--r-- | config-db/OpenSLX/ConfigDB.pm | 30 | ||||
-rw-r--r-- | config-db/OpenSLX/DBSchema.pm | 2 |
2 files changed, 30 insertions, 2 deletions
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<getColumnsOfTable($tableName)> + +Returns the names of the columns of the given table. + +=over + +=item Param C<tableName> + +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<fetchVendorOSByFilter([%$filter], [$resultCols])> 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' => [ |