Skip to content

Commit

Permalink
adds form module showall view setting to prevent individual record vi…
Browse files Browse the repository at this point in the history
…ewing (just display the list, not allow for single records display)
  • Loading branch information
dleffler committed May 4, 2016
1 parent a4bc160 commit d55cc3f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
17 changes: 17 additions & 0 deletions framework/modules/forms/views/forms/configure/showall.config
@@ -0,0 +1,17 @@
{*
* Copyright (c) 2004-2016 OIC Group, Inc.
*
* This file is part of Exponent
*
* Exponent is free software; you can redistribute
* it and/or modify it under the terms of the GNU
* General Public License as published by the Free
* Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* GPL: http://www.gnu.org/licenses/gpl.txt
*
*}

<h2>{'Configure Show All Records View'|gettext}</h2>
{control type="checkbox" name="hide_view" label="Prevent individual record viewing"|gettext value=1 checked=$config.hide_view}
8 changes: 5 additions & 3 deletions framework/modules/forms/views/forms/showall.bootstrap.tpl
Expand Up @@ -73,7 +73,7 @@
<td>
{if $field|lower == 'email'}
<a href="mailto:{$fields.$field}">
{elseif $caption@iteration == 1}
{elseif $caption@iteration == 1 && !$config.hide_view}
<a href={link action=show forms_id=$f->id id=$fields.id}>
{/if}
{if $field|lower == 'image'}
Expand All @@ -91,14 +91,16 @@
{else}
{$fields.$field}
{/if}
{if $field|lower == 'email' || $caption@iteration == 1}
{if $field|lower == 'email' || ($caption@iteration == 1 && !$config.hide_view)}
</a>
{/if}
</td>
{/foreach}
<div class="item-actions">
<td>
{icon img="view.png" action=show forms_id=$f->id id=$fields.id title='View all data fields for this record'|gettext}
{if !$config.hide_view || !$permissions.manage}
{icon img="view.png" action=show forms_id=$f->id id=$fields.id title='View all data fields for this record'|gettext}
{/if}
{if $permissions.edit}
{icon img="edit.png" action=enterdata forms_id=$f->id id=$fields.id title='Edit this record'|gettext}
{/if}
Expand Down
8 changes: 5 additions & 3 deletions framework/modules/forms/views/forms/showall.bootstrap3.tpl
Expand Up @@ -73,7 +73,7 @@
<td>
{if $field|lower == 'email'}
<a href="mailto:{$fields.$field}">
{elseif $caption@iteration == 1}
{elseif $caption@iteration == 1 && !$config.hide_view}
<a href={link action=show forms_id=$f->id id=$fields.id}>
{/if}
{if $field|lower == 'image'}
Expand All @@ -91,14 +91,16 @@
{else}
{$fields.$field}
{/if}
{if $field|lower == 'email' || $caption@iteration == 1}
{if $field|lower == 'email' || ($caption@iteration == 1 && !$config.hide_view)}
</a>
{/if}
</td>
{/foreach}
<div class="item-actions">
<td>
{icon img="view.png" action=show forms_id=$f->id id=$fields.id title='View all data fields for this record'|gettext}
{if !$config.hide_view || !$permissions.manage}
{icon img="view.png" action=show forms_id=$f->id id=$fields.id title='View all data fields for this record'|gettext}
{/if}
{if $permissions.edit}
{icon img="edit.png" action=enterdata forms_id=$f->id id=$fields.id title='Edit this record'|gettext}
{/if}
Expand Down
8 changes: 5 additions & 3 deletions framework/modules/forms/views/forms/showall.tpl
Expand Up @@ -73,7 +73,7 @@
<td>
{if $field|lower == 'email'}
<a href="mailto:{$fields.$field}">
{elseif $caption@iteration == 1}
{elseif $caption@iteration == 1 && !$config.hide_view}
<a href={link action=show forms_id=$f->id id=$fields.id}>
{/if}
{if $field|lower == 'image'}
Expand All @@ -91,14 +91,16 @@
{else}
{$fields.$field}
{/if}
{if $field|lower == 'email' || $caption@iteration == 1}
{if $field|lower == 'email' || ($caption@iteration == 1 && ! $config.hide_view)}
</a>
{/if}
</td>
{/foreach}
<div class="item-actions">
<td>
{icon img="view.png" action=show forms_id=$f->id id=$fields.id title='View all data fields for this record'|gettext}
{if !$config.hide_view || !$permissions.manage}
{icon img="view.png" action=show forms_id=$f->id id=$fields.id title='View all data fields for this record'|gettext}
{/if}
{if $permissions.edit}
{icon img="edit.png" action=enterdata forms_id=$f->id id=$fields.id title='Edit this record'|gettext}
{/if}
Expand Down

0 comments on commit d55cc3f

Please sign in to comment.