Skip to content

Commit

Permalink
Dev: activate survey message box rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jan 13, 2016
1 parent 38bc158 commit 48da2b3
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 123 deletions.
260 changes: 137 additions & 123 deletions application/views/admin/survey/activateSurvey_view.php
Expand Up @@ -9,28 +9,28 @@
<p>
<?php eT("The following problems have been found:"); ?><br />
<ul class="list-unstyled">
<?php
<?php
if (isset($failedcheck) && $failedcheck)
{
foreach ($failedcheck as $fc)
{ ?>

<li> Question qid-<?php echo $fc[0]; ?> ("<a href='<?php echo Yii::app()->getController()->createUrl('admin/questions/sa/view/surveyid/'.$surveyid.'/gid/'.$fc[3].'/qid/'.$fc[0]); ?>'><?php echo $fc[1]; ?></a>")<?php echo $fc[2]; ?></li>
<?php }
}

if (isset($failedgroupcheck) && $failedgroupcheck)
{
foreach ($failedgroupcheck as $fg)
{ ?>

<li> Group gid-<?php echo $fg[0]; ?> ("<a href='<?php echo Yii::app()->getController()->createUrl('admin/questiongroups/sa/view/surveyid/'.$surveyid.'/gid/'.$fg[0]); ?>'><?php echo $fg[1]; ?></a>")<?php echo $fg[2]; ?></li>
<?php }
} ?>
</ul>
<?php eT("The survey cannot be activated until these problems have been resolved."); ?>
<?php eT("The survey cannot be activated until these problems have been resolved."); ?>
</p>

<p>
<a class="btn btn-default" href="<?php echo $this->createUrl("admin/survey/sa/view/surveyid/$surveyid"); ?>" role="button">
<?php eT("Return to survey"); ?>
Expand All @@ -40,23 +40,21 @@
</div>
<?php else:?>

<div class='side-body container message-box col-lg-10'>
<div class='side-body container message-box col-lg-10' >
<div class='row'>
<div class='col-sm-4'></div>
<h2 class='col-sm-7'><?php eT("Warning"); ?>! <?php eT("READ THIS CAREFULLY BEFORE PROCEEDING"); ?></h2>
<h2 class='col-sm-12 text-center'><?php eT("Warning"); ?>! <?php eT("READ THIS CAREFULLY BEFORE PROCEEDING"); ?></h2>
</div>
<div class='row'>
<div class='col-sm-4'></div>
<p class="lead col-sm-6">
<p class="lead col-sm-12 text-center">
<?php eT("You should only activate a survey when you are absolutely certain that your survey setup is finished and will not need changing."); ?>
</p>
</div>
<div class='row'>
<p class="col-sm-8 col-sm-offset-4">
<p class="col-sm-12 text-center">
<?php eT("Once a survey is activated you can no longer:"); ?>
</p>
<div class='col-sm-8 col-sm-offset-4'>
<ul class='m-l-3'>
<div class='col-sm-8 col-sm-offset-5'>
<ul class=''>
<li><?php eT("Add or delete groups"); ?></li>
<li><?php eT("Add or delete questions"); ?></li>
<li><?php eT("Add or delete subquestions or change their codes"); ?></li>
Expand All @@ -65,142 +63,158 @@
</div>

<div class='row'>
<strong class="text-warning col-sm-8 col-sm-offset-4">
<strong class="text-warning col-sm-12 text-center">
<?php eT("The following settings cannot be changed when the survey is active.");?><br/>
</strong>
</div>
<div class='row'>
<p class='col-sm-8 col-sm-offset-4'>
<p class='col-sm-12 text-center'>
<?php eT("Please check these settings now, then click the button below.");?>
</p>
</div>
<div class='row'>
<?php echo CHtml::form(array("admin/survey/sa/activate/surveyid/{$surveyid}/"), 'post', array('class'=>'form-horizontal')); ?>
<div class='form-group'>
<label for='anonymized' class='control-label col-sm-6'>
<?php eT("Anonymized responses?"); ?>
<script type="text/javascript"><!--
function alertPrivacy()
{
if (document.getElementById('anonymized').value == 'Y')
{
alert('<?php eT("Warning"); ?>: <?php eT("If you turn on the -Anonymized responses- option and create a tokens table, LimeSurvey will mark your completed tokens only with a 'Y' instead of date/time to ensure the anonymity of your participants.","js"); ?>');
}
}
//--></script>
</label>

<?php /*$this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => 'anonymizedazd',
'htmlOptions' => array(
'id' => 'anonymizedazd',
)
)); */ ?>

<div class='col-sm-1'>
<select id='anonymized' class='form-control' name='anonymized' onchange='alertPrivacy();'>
<option value='Y'
<?php if ($aSurveysettings['anonymized'] == "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("Yes"); ?></option>
<option value='N'
<?php if ($aSurveysettings['anonymized'] != "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("No"); ?></option>
</select>
<?php echo CHtml::form(array("admin/survey/sa/activate/surveyid/{$surveyid}/"), 'post', array('class'=>'form-horizontal')); ?>
<div class='row'>
<div class="col-sm-3 col-sm-offset-3">
<div class="row">
<div class='form-group'>
<label for='anonymized' class='control-label col-sm-6'>
<?php eT("Anonymized responses?"); ?>
<script type="text/javascript">
<!--
function alertPrivacy()
{
if (document.getElementById('anonymized').value == 'Y')
{
alert('<?php eT("Warning"); ?>: <?php eT("If you turn on the -Anonymized responses- option and create a tokens table, LimeSurvey will mark your completed tokens only with a 'Y' instead of date/time to ensure the anonymity of your participants.","js"); ?>');
}
}
//-->
</script>
</label>

<?php /*$this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => 'anonymizedazd',
'htmlOptions' => array(
'id' => 'anonymizedazd',
)
)); */ ?>

<div class='col-sm-6'>
<select id='anonymized' class='form-control' name='anonymized' onchange='alertPrivacy();'>
<option value='Y'
<?php if ($aSurveysettings['anonymized'] == "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("Yes"); ?></option>
<option value='N'
<?php if ($aSurveysettings['anonymized'] != "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("No"); ?></option>
</select>
</div>
</div>
</div>
</div>
</div>

<div class='form-group'>
<label for='datestamp' class='control-label col-sm-6'><?php eT("Date stamp?"); ?></label>
<div class='col-sm-1'>
<select id='datestamp' class='form-control' name='datestamp' onchange='alertDateStampAnonymization();'>
<option value='Y'
<?php if ($aSurveysettings['datestamp'] == "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("Yes"); ?></option>
<option value='N'
<?php if ($aSurveysettings['datestamp'] != "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("No"); ?></option>
</select>
<div class="col-sm-3">
<div class="row">
<div class='form-group'>
<label for='datestamp' class='control-label col-sm-5'>
<?php eT("Date stamp?"); ?>
</label>
<div class='col-sm-6'>
<select id='datestamp' class='form-control' name='datestamp' onchange='alertDateStampAnonymization();'>
<option value='Y' <?php if ($aSurveysettings['datestamp'] == "Y"){echo 'selected="selected"';}?>>
<?php eT("Yes"); ?>
</option>

<option value='N' <?php if ($aSurveysettings['datestamp'] != "Y"){echo "selected='selected'";}?>>
<?php eT("No"); ?>
</option>
</select>
</div>
</div>
</div>
</div>
</div>

<div class='row'>
<div class="col-sm-3 col-sm-offset-3">
<div class="row">
<div class='form-group'>
<label for='ipaddr' class='control-label col-sm-6'>
<?php eT("Save IP address?"); ?>
</label>

<div class='form-group'>
<label for='ipaddr' class='control-label col-sm-6'><?php eT("Save IP address?"); ?></label>

<div class='col-sm-1'>
<select name='ipaddr' id='ipaddr' class='form-control'>
<option value='Y'
<?php if ($aSurveysettings['ipaddr'] == "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("Yes"); ?>
</option>

<option value='N'
<?php if ($aSurveysettings['ipaddr'] != "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("No"); ?>
</option>
</select>
<div class='col-sm-6'>
<select name='ipaddr' id='ipaddr' class='form-control'>
<option value='Y' <?php if ($aSurveysettings['ipaddr'] == "Y") {echo "selected='selected'";} ?>>
<?php eT("Yes"); ?>
</option>
<option value='N' <?php if ($aSurveysettings['ipaddr'] != "Y") { echo "selected='selected'";} ?>>
<?php eT("No"); ?>
</option>
</select>
</div>
</div>
</div>
</div>
</div>

<div class='form-group'>
<label class='control-label col-sm-6' for='refurl'><?php eT("Save referrer URL?"); ?></label>
<div class='col-sm-1'>
<select class='form-control' name='refurl' id='refurl'>
<option value='Y'
<?php if ($aSurveysettings['refurl'] == "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("Yes"); ?>
</option>
<option value='N'
<?php if ($aSurveysettings['refurl'] != "Y") { ?>
selected='selected'
<?php } ?>
><?php eT("No"); ?>
</option>
</select>
<div class="col-sm-3">
<div class="row">

<div class='form-group'>
<label class='control-label col-sm-5' for='refurl'><?php eT("Save referrer URL?"); ?></label>
<div class='col-sm-6'>
<select class='form-control' name='refurl' id='refurl'>
<option value='Y' <?php if ($aSurveysettings['refurl'] == "Y"){echo "selected='selected'";} ?>>
<?php eT("Yes"); ?>
</option>
<option value='N' <?php if ($aSurveysettings['refurl'] != "Y") {echo "selected='selected'";} ?>>
<?php eT("No"); ?>
</option>
</select>
</div>
</div>
</div>
</div>
</div>

<div class='form-group'>
<label class='control-label col-sm-6' for='savetimings'><?php eT("Save timings?"); ?></label>
<div class='col-sm-1'>
<select class='form-control' id='savetimings' name='savetimings'>
<option value='Y'
<?php if (!isset($aSurveysettings['savetimings']) || !$aSurveysettings['savetimings'] || $aSurveysettings['savetimings'] == "Y") { ?> selected='selected' <?php } ?>
><?php eT("Yes"); ?></option>
<option value='N'
<?php if (isset($aSurveysettings['savetimings']) && $aSurveysettings['savetimings'] == "N") { ?> selected='selected' <?php } ?>
><?php eT("No"); ?></option>
</select>
<div class="row">
<div class="col-sm-3 col-sm-offset-3">
<div class="row">
<div class='form-group'>
<label class='control-label col-sm-6' for='savetimings'><?php eT("Save timings?"); ?></label>
<div class='col-sm-6'>
<select class='form-control' id='savetimings' name='savetimings'>
<option value='Y' <?php if (!isset($aSurveysettings['savetimings']) || !$aSurveysettings['savetimings'] || $aSurveysettings['savetimings'] == "Y") { ?> selected='selected' <?php } ?>>
<?php eT("Yes"); ?>
</option>

<option value='N' <?php if (isset($aSurveysettings['savetimings']) && $aSurveysettings['savetimings'] == "N") { ?> selected='selected' <?php } ?>>
<?php eT("No"); ?>
</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='row'>

<p class='col-sm-6 col-sm-offset-4'>
<?php eT("Please note that once responses have collected with this survey and you want to add or remove groups/questions or change one of the settings above, you will need to deactivate this survey, which will move all data that has already been entered into a separate archived table."); ?><br /><br />
<div class='row'>

<p class='col-sm-4 text-center col-sm-offset-4'>
<?php eT("Please note that once responses have collected with this survey and you want to add or remove groups/questions or change one of the settings above, you will need to deactivate this survey, which will move all data that has already been entered into a separate archived table."); ?><br /><br />
</p>
</div>
<div class='row'>
<div class='col-sm-7 col-sm-offset-5'>
<input type='hidden' name='ok' value='Y' />
<input type='submit' class="btn btn-danger " value="<?php eT("Save / Activate survey"); ?>" />
<a class="btn" href="<?php echo $this->createUrl("admin/survey/sa/view/surveyid/$surveyid"); ?>" role="button">
<input type='submit' class="btn btn-default btn-lg " value="<?php eT("Save / Activate survey"); ?>" />
<a class="btn btn-lg" href="<?php echo $this->createUrl("admin/survey/sa/view/surveyid/$surveyid"); ?>" role="button">
<< <?php eT("Return to survey"); ?>
</a>
</a>
</p>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions styles/Black_Pearl/css/lime-admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions styles/Sea_Green/css/lime-admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48da2b3

Please sign in to comment.