Girocco/CGI.pm: allow field sets in metadata_fields
The $Girocco::Project::metadata_fields variable is a HASH ref
containing the necessary information for Girocco::CGI::print_form_fields
to emit the fields as XHTML markup.
Each key of metadata_fields can be enabled or disabled by including
it or not in the @Girocco::Config::project_fields array.
However, sometimes more than one field must be shown to properly edit
a logical field. For example, the JSON notification mechanism
requires both a URL and a Content-Type. It does not make sense to
show one field without the other.
Change the semantics of metadata_fields so that each entry can be
an ARRAY ref of fields rather than just an ARRAY ref of a single field.
Detect this automatically to minimize changes to the interpretation of
the metadata_fields HASH ref.
Update the print_form_fields function to support these new semantics
thereby removing the ugly kludge for the 'jsontype' field and group
the 'notifyjson' and 'jsontype' fields together as a set under the
'notifyjson' entry in metadata_fields.
Also take this opportunity to enhance the callback used to obtain
the list of possible values by passing it the Girocco::Project
object as its single argument if that's available (it is for
editproj.cgi but it's not for regproj.cgi).
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>