hide default thing until there are things to list

This commit is contained in:
JT Smith 2008-04-28 23:53:08 +00:00
parent 6471d3103e
commit e9853fdf5c

View file

@ -526,12 +526,14 @@ sub getEditForm {
my $things = $self->session->db->buildHashRef('select thingId, label from Thingy_things where assetId = ?',[$self->get("assetId")]);
$tabform->getTab("display")->selectBox(
-name=>"defaultThingId",
-value=>$self->get("defaultThingId"),
-label=>$i18n->get("default thing label"),
-options=>$things,
);
unless (scalar(keys(%{$things}))) {
$tabform->getTab("display")->selectBox(
-name=>"defaultThingId",
-value=>$self->get("defaultThingId"),
-label=>$i18n->get("default thing label"),
-options=>$things,
);
}
return $tabform;
}