Skip to content

Commit

Permalink
Fixed the ability to choose a return view in forms and reports.
Browse files Browse the repository at this point in the history
  • Loading branch information
timbuckingham committed Dec 30, 2014
1 parent 2bae9be commit 9257c12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions core/admin/modules/developer/modules/forms/add.php
Expand Up @@ -20,7 +20,7 @@
}

// Find out if we have more than one view. If so, give them an option of which one to return to.
$available_views = $admin->getModuleViews("action_name",$module["id"]);
$available_views = $admin->getModuleViews("title",$module["id"]);

$title = htmlspecialchars(urldecode($title));
?>
Expand Down Expand Up @@ -53,7 +53,7 @@
<label>Return View <small>(after the form is submitted, it will return to this view)</small></label>
<select name="return_view">
<? foreach ($available_views as $view) { ?>
<option value="<?=$view["id"]?>"<? if (isset($_GET["view"]) && $_GET["view"] == $view["id"]) { ?> selected="selected"<? } ?>><?=$view["action_name"]?></option>
<option value="<?=$view["id"]?>"<? if (isset($_GET["view"]) && $_GET["view"] == $view["id"]) { ?> selected="selected"<? } ?>><?=$view["title"]?></option>
<? } ?>
</select>
</fieldset>
Expand Down
4 changes: 2 additions & 2 deletions core/admin/modules/developer/modules/forms/edit.php
Expand Up @@ -6,7 +6,7 @@
$fields = $form["fields"];

// Find out if we have more than one view. If so, give them an option of which one to return to.
$available_views = $admin->getModuleViews("action_name",$module["id"]);
$available_views = $admin->getModuleViews("title",$module["id"]);

if (!BigTree::tableExists($table)) {
?>
Expand Down Expand Up @@ -56,7 +56,7 @@
<label>Return View <small>(after the form is submitted, it will return to this view)</small></label>
<select name="return_view">
<? foreach ($available_views as $view) { ?>
<option value="<?=$view["id"]?>"<? if ($form["return_view"] == $view["id"]) { ?> selected="selected"<? } ?>><?=$view["action_name"]?></option>
<option value="<?=$view["id"]?>"<? if ($form["return_view"] == $view["id"]) { ?> selected="selected"<? } ?>><?=$view["title"]?></option>
<? } ?>
</select>
</fieldset>
Expand Down
4 changes: 2 additions & 2 deletions core/admin/modules/developer/modules/reports/add.php
Expand Up @@ -4,7 +4,7 @@
$type = "csv";

// Find out available views to use
$available_views = $admin->getModuleViews("action_name",$module["id"]);
$available_views = $admin->getModuleViews("title",$module["id"]);
?>
<div class="container">
<form method="post" action="<?=SECTION_ROOT?>create/<?=$module["id"]?>/" class="module">
Expand Down Expand Up @@ -43,7 +43,7 @@
<label>Filtered View <small>(after the report is submitted, it will show data using this view)</small></label>
<select name="return_view">
<? foreach ($available_views as $view) { ?>
<option value="<?=$view["id"]?>"<? if (isset($_GET["view"]) && $_GET["view"] == $view["id"]) { ?> selected="selected"<? } ?>><?=$view["action_name"]?></option>
<option value="<?=$view["id"]?>"<? if (isset($_GET["view"]) && $_GET["view"] == $view["id"]) { ?> selected="selected"<? } ?>><?=$view["title"]?></option>
<? } ?>
</select>
</fieldset>
Expand Down
4 changes: 2 additions & 2 deletions core/admin/modules/developer/modules/reports/edit.php
Expand Up @@ -4,7 +4,7 @@
BigTree::globalizeArray($report);

// Find out available views to use
$available_views = $admin->getModuleViews("action_name",$action["module"]);
$available_views = $admin->getModuleViews("title",$action["module"]);
?>
<div class="container">
<form method="post" action="<?=SECTION_ROOT?>update/<?=$report["id"]?>/" class="module">
Expand Down Expand Up @@ -46,7 +46,7 @@
<label>Filtered View <small>(after the report is submitted, it will show data using this view)</small></label>
<select name="return_view">
<? foreach ($available_views as $v) { ?>
<option value="<?=$v["id"]?>"<? if ($view == $v["id"]) { ?> selected="selected"<? } ?>><?=$v["action_name"]?></option>
<option value="<?=$v["id"]?>"<? if ($view == $v["id"]) { ?> selected="selected"<? } ?>><?=$v["title"]?></option>
<? } ?>
</select>
</fieldset>
Expand Down

0 comments on commit 9257c12

Please sign in to comment.