Skip to content

Commit

Permalink
fix issues with form control 'output as link' for email controls
Browse files Browse the repository at this point in the history
(cherry picked from commit 0d3e4c8)
  • Loading branch information
dleffler committed Oct 29, 2016
1 parent bd35998 commit b49d22b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
10 changes: 8 additions & 2 deletions framework/modules/forms/controllers/formsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,14 @@ public function showall() {
if (empty($this->config['column_names_list'])) {
//define some default columns...
$controls = $fc->find('all', 'forms_id=' . $f->id . ' AND is_readonly=0 AND is_static = 0', 'rank');
foreach (array_slice($controls, 0, 5) as $control) { // default to only first 5 columns
$this->config['column_names_list'][] = $control->name;
if (!empty($this->params['view']) && $this->params['view'] == 'showall_portfolio') {
foreach ($controls as $control) { // we need to output all columns for portfolio view
$this->config['column_names_list'][] = $control->name;
}
} else {
foreach (array_slice($controls, 0, 5) as $control) { // default to only first 5 columns
$this->config['column_names_list'][] = $control->name;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{$captions.$fieldname}
</td>
<td>
{if $fieldname|lower == 'email'}
{if $fieldname|lower == 'email' && stripos($value, '<a ') === false}
<a href="mailto:{$value}">{$value}</a>
{elseif $fieldname|lower == 'image'}
{$matches = array()}
Expand Down
2 changes: 1 addition & 1 deletion framework/modules/forms/views/forms/show.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<tr class="{cycle values="even,odd"}">
<td>{$captions.$fieldname}</td>
<td>
{if $fieldname|lower == 'email'}
{if $fieldname|lower == 'email' && stripos($value, '<a ') === false}
<a href="mailto:{$value}">{$value}</a>
{elseif $fieldname|lower == 'image'}
{$matches = array()}
Expand Down
2 changes: 1 addition & 1 deletion framework/modules/forms/views/forms/showall.bootstrap.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<tr>
{foreach $page->columns as $field=>$caption}
<td>
{if $field|lower == 'email'}
{if $field|lower == 'email' && stripos($value, '<a ') === false}
<a href="mailto:{$fields.$field}">
{elseif $caption@iteration == 1 && !$config.hide_view}
<a href={link action=show forms_id=$f->id id=$fields.id}>
Expand Down
2 changes: 1 addition & 1 deletion framework/modules/forms/views/forms/showall.bootstrap3.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<tr>
{foreach $page->columns as $field=>$caption}
<td>
{if $field|lower == 'email'}
{if $field|lower == 'email' && stripos($value, '<a ') === false}
<a href="mailto:{$fields.$field}">
{elseif $caption@iteration == 1 && !$config.hide_view}
<a href={link action=show forms_id=$f->id id=$fields.id}>
Expand Down
2 changes: 1 addition & 1 deletion framework/modules/forms/views/forms/showall.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<tr>
{foreach $page->columns as $field=>$caption}
<td>
{if $field|lower == 'email'}
{if $field|lower == 'email' && stripos($value, '<a ') === false}
<a href="mailto:{$fields.$field}">
{elseif $caption@iteration == 1 && !$config.hide_view}
<a href={link action=show forms_id=$f->id id=$fields.id}>
Expand Down
2 changes: 1 addition & 1 deletion framework/modules/forms/views/forms/showall_portfolio.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
{$captions.$fieldname}
</td>
<td>
{if $fieldname|lower == 'email'}
{if $fieldname|lower == 'email' && stripos($value, '<a ') === false}
<a href="mailto:{$value}">{$value}</a>
{elseif $fieldname|lower == 'image'}
{$matches = array()}
Expand Down

0 comments on commit b49d22b

Please sign in to comment.