'This method gets all the unsaved user-entered form details and returns a
dictionary containing the name, desc, type, layout & fields of the form'

def get_current_form(self, trans, **kwd):

    params = util.Params(kwd)
    name = util.restore_text(params.name)
    desc = (util.restore_text(params.description) or '')
    form_type = util.restore_text(params.form_type_select_field)
    layout = []
    if (form_type == trans.model.FormDefinition.types.SAMPLE):
        index = 0
        while True:
            if (('grid_layout%i' % index) in kwd):
                grid_name = util.restore_text(params.get(('grid_layout%i' % index), ''))
                layout.append(grid_name)
                index = (index + 1)
            else:
                break
    csv_file = params.get('file_data', '')
    fields = []
    if (csv_file == ''):
        index = 0
        while True:
            if (('field_label_%i' % index) in kwd):
                fields.append(self.__get_field(index, **kwd))
                index = (index + 1)
            else:
                break
        fields = fields
    else:
        (fields, layout) = self.__import_fields(trans, csv_file, form_type)
    return dict(name=name, desc=desc, type=form_type, layout=layout, fields=fields)
