Skip to content

Commit

Permalink
Dev: fix views survey create (#769)
Browse files Browse the repository at this point in the history
Dev: fix views: survey create
Dev: clean
  • Loading branch information
TonisOrmisson committed Jul 14, 2017
1 parent 84962ac commit 9b43b1a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion application/controllers/admin/surveyadmin.php
Expand Up @@ -149,7 +149,8 @@ public function newsurvey()
$aData = $this->_generalTabNewSurvey();
$aData = array_merge($aData, $this->_getGeneralTemplateData(0));
$aData['esrow'] = $esrow;

$aData['oSurvey'] = $survey;

//Prepare the edition panes

$aData['edittextdata'] = array_merge($aData, $this->_getTextEditData($survey));
Expand All @@ -162,6 +163,7 @@ public function newsurvey()
$aViewUrls[] = 'newSurvey_view';

$arrayed_data = array();
$arrayed_data['oSurvey'] = $survey;
$arrayed_data['data'] = $aData;
$arrayed_data['title_bar']['title'] = gT('New survey');
$arrayed_data['fullpagebar']['savebutton']['form'] = 'addnewsurvey';
Expand Down
2 changes: 2 additions & 0 deletions application/views/admin/survey/newSurvey_view.php
@@ -1,6 +1,8 @@
<?php
/**
* Create survey
* @var AdminController $this
* @var Survey $oSurvey
*/
?>
<!-- new survey view -->
Expand Down
@@ -1,6 +1,8 @@
<?php
/**
* General container for create survey action
* @var AdminController $this
* @var Survey $oSurvey
*/
?>

Expand Down
Expand Up @@ -126,7 +126,7 @@ function checkSelect2Languages(mylangs)
<!-- Administrator -->
<div class="form-group">
<?php //Switch for creation/editing ?>
<?php $admin = empty($oSurvey->admin) ? $oSurvey->owner->full_name : $oSurvey->admin; ?>
<?php $admin = ($oSurvey->owner ? $oSurvey->owner->full_name : $oSurvey->admin); ?>
<label class="col-sm-3 control-label" for='admin'><?php eT("Administrator:"); ?></label>
<div class="col-sm-9">
<input class="form-control" type='text' size='50' id='admin' name='admin' value="<?php echo htmlspecialchars($admin); ?>" />
Expand All @@ -136,7 +136,7 @@ function checkSelect2Languages(mylangs)
<!-- Admin email -->
<div class="form-group">
<?php //Switch for creation/editing ?>
<?php $admin_email = empty($oSurvey->adminemail) ? $oSurvey->owner->email : $oSurvey->adminemail; ?>
<?php $admin_email = $oSurvey->adminemail ? $oSurvey->owner->email : $oSurvey->adminemail; ?>
<label class="col-sm-3 control-label" for='adminemail'><?php eT("Admin email:"); ?></label>
<div class="col-sm-9">
<input class="form-control" type='email' size='50' id='adminemail' name='adminemail' value="<?php echo htmlspecialchars($admin_email); ?>" />
Expand All @@ -146,7 +146,7 @@ function checkSelect2Languages(mylangs)
<!-- Bounce email -->
<div class="form-group">
<?php //Switch for creation/editing ?>
<?php $bounce_email = empty($oSurvey->bounce_email) ? $oSurvey->owner->email : $oSurvey->bounce_email; ?>
<?php $bounce_email = ($oSurvey->bounce_email ? $oSurvey->bounce_email : $oSurvey->adminemail); ?>
<label class="col-sm-3 control-label" for='bounce_email'><?php eT("Bounce email:"); ?></label>
<div class="col-sm-9">
<input class="form-control" type='email' size='50' id='bounce_email' name='bounce_email' value="<?php echo htmlspecialchars($bounce_email); ?>" />
Expand Down
3 changes: 3 additions & 0 deletions application/views/admin/survey/subview/tabCreate_view.php
Expand Up @@ -2,6 +2,9 @@
/**
* Tab Create content
* This view display the content for the create tab.
* @var AdminController $this
* @var Survey $oSurvey
*
*/
?>
<?php
Expand Down

0 comments on commit 9b43b1a

Please sign in to comment.