Added a method to check to see if a profile category has protected fields.

Use that method to see prevent the category from being deleted in the ProfileSettings operation.
Change the delete profile confirmation message to match what it does, which is delete all
the fields in the category.
This commit is contained in:
Colin Kuskie 2008-06-27 20:57:54 +00:00
parent e51d02e3d8
commit bc9ddbf163
4 changed files with 39 additions and 17 deletions

View file

@ -177,6 +177,27 @@ sub getLabel {
return WebGUI::Operation::Shared::secureEval($self->session,$self->get("label"));
}
#-------------------------------------------------------------------
=head2 hasProtected ( )
Returns a boolean indicating whether any of the category's fields are protected.
=cut
sub hasProtected {
my $self = shift;
my $protected=0;
FIELD: foreach my $field (@{ $self->getFields }) {
if ($field->isProtected) {
$protected=1;
last FIELD;
}
}
return $protected;
}
#-------------------------------------------------------------------
=head2 isEditable ( )