added direct value access in DataForm list view
This commit is contained in:
parent
e161afd5c0
commit
ed8a0dac5c
5 changed files with 201 additions and 0 deletions
|
|
@ -713,9 +713,11 @@ sub getListTemplateVars {
|
|||
while ( my $entry = $entryIter->() ) {
|
||||
my $entryData = $entry->fields;
|
||||
my @dataLoop;
|
||||
my %dataVars;
|
||||
for my $fieldName ( @{ $self->getFieldOrder } ) {
|
||||
my $field = $fieldConfig->{$fieldName};
|
||||
my $form = $self->_createForm($field, $entryData->{$fieldName});
|
||||
$dataVars{ 'record.noloop.' . $fieldName } = $entryData->{$fieldName};
|
||||
push @dataLoop, {
|
||||
"record.data.name" => $field->{name},
|
||||
"record.data.label" => $field->{label},
|
||||
|
|
@ -725,6 +727,7 @@ sub getListTemplateVars {
|
|||
};
|
||||
}
|
||||
push @recordLoop, {
|
||||
%dataVars,
|
||||
"record.ipAddress" => $entry->ipAddress,
|
||||
"record.edit.url" => $self->getFormUrl("func=view;entryId=".$entry->getId),
|
||||
"record.edit.icon" => $self->session->icon->edit("func=view;entryId=".$entry->getId, $self->get('url')),
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ our $HELP = {
|
|||
{ 'name' => 'record.userId' },
|
||||
{ 'name' => 'record.submissionDate.epoch' },
|
||||
{ 'name' => 'record.submissionDate.human' },
|
||||
{ 'name' => 'record.noloop.', description => 'help record.noloop', },
|
||||
{ 'name' => 'record.data_loop',
|
||||
'variables' => [
|
||||
{ 'name' => 'record.data.name' },
|
||||
|
|
|
|||
|
|
@ -1044,6 +1044,12 @@ be useful, others may not.|,
|
|||
context => q{The date that this entry was submitted to the site. i18n label for template},
|
||||
},
|
||||
|
||||
'help record.noloop' => {
|
||||
message => q{You can get any field's value in this record by name, ex: record.noloop.subject},
|
||||
lastUpdated => 0,
|
||||
context => q{Help for template variable},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue