Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Helloworld.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function showPage()
$subhead = _('Item List');
$content = load_view(__DIR__ . '/views/grid.php');

if ('form' == $_REQUEST['view']) {
if (isset($_REQUEST['view']) && 'form' == $_REQUEST['view']) {
$subhead = _('Add Item');
$content = load_view(__DIR__ . '/views/form.php');
if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) {
Expand Down
2 changes: 1 addition & 1 deletion module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<category>Development</category>
<Publisher>James Finstrom</Publisher>
<info>http://wiki.freepbx.org/pages/viewpage.action?pageId=19498386</info>
<licence>GPL</licence>
<license>GPL</license>
<licenselink>http://www.gnu.org/licenses/gpl-2.0.txt</licenselink>
<database>
<table name="helloworld">
Expand Down
11 changes: 5 additions & 6 deletions views/form.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<form action="" method="post" class="fpbx-submit" id="hwform" name="hwform" data-fpbx-delete="config.php?display=helloworld&action=delete&id=<?php echo $id?>">
<input type="hidden" name='action' value="<?php echo $id?'edit':'add' ?>">
<form action="" method="post" class="fpbx-submit" id="hwform" name="hwform" data-fpbx-delete="config.php?display=helloworld&action=delete&id=<?php echo isset($id) ? $id : '' ?>">
<input type="hidden" name='action' value="<?php echo ( isset($id) && $id ) ? 'edit' : 'add' ?>">
<!--Subject-->
<div class="element-container">
<div class="row">
Expand All @@ -11,7 +11,7 @@
<i class="fa fa-question-circle fpbx-help-icon" data-for="subject"></i>
</div>
<div class="col-md-9">
<input type="text" class="form-control" id="subject" name="subject" value="<?php echo $subject?>">
<input type="text" class="form-control" id="subject" name="subject" value="<?php echo isset($subject) ? $subject : '' ?>">
</div>
</div>
</div>
Expand All @@ -35,8 +35,7 @@
<i class="fa fa-question-circle fpbx-help-icon" data-for="body"></i>
</div>
<div class="col-md-9">
<textarea class="form-control" id="body" name="body"><?php echo $body?>
</textarea>
<textarea class="form-control" id="body" name="body"><?php echo isset($body) ? $body : '' ?></textarea>
</div>
</div>
</div>
Expand All @@ -49,4 +48,4 @@
</div>
</div>
<!--END Body-->
</form>
</form>