Skip to content

Commit

Permalink
Dev: select between the 6 chartjs from advanced settings
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jan 14, 2016
1 parent 23465d8 commit 809a5da
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 45 deletions.
1 change: 0 additions & 1 deletion application/helpers/admin/statistics_helper.php
Expand Up @@ -640,7 +640,6 @@ protected function buildOutputList($rt, $language, $surveyid, $outputType, $sql,
$qtype="";
$statlang = $oLanguage;
$firstletter = substr($rt, 0, 1);
var_dump($firstletter);
$fieldmap=createFieldMap($surveyid, "full", false, false, $language);
$sDatabaseType = Yii::app()->db->getDriverName();
$statisticsoutput="";
Expand Down
9 changes: 8 additions & 1 deletion application/helpers/common_helper.php
Expand Up @@ -2988,7 +2988,14 @@ function questionAttributes($returnByName=false)
'category'=>gT('Statistics'),
'inputtype'=>'singleselect',
'sortorder'=>102,
'options'=>array(0=>gT('Bar chart'), 1=>gT('Pie chart')),
'options'=>array(
0=>gT('Bar chart'),
1=>gT('Pie chart'),
2=>gT('Radar'),
3=>gT('Line'),
4=>gT('PolarArea'),
5=>gT('Doughnut'),
),
'help'=>gT("Select the type of chart to be displayed"),
'caption'=>gT("Chart type"),
'default'=>0
Expand Down
86 changes: 43 additions & 43 deletions application/views/admin/survey/Question/advanced_settings_view.php
Expand Up @@ -10,46 +10,46 @@
}
$currentfieldset=$aAttribute['category'];
?>
<fieldset>
<legend><?php echo $aAttribute['category'];?></legend>
<?php
}?>
<div class="form-group">
<label class="col-sm-4 control-label" for='<?php echo $aAttribute['name'];?>' title='<?php echo $aAttribute['help'];?>'><?php echo $aAttribute['caption'];
if ($aAttribute['i18n']==true) { ?> (<?php echo $aAttribute['language'] ?>)<?php }?>
</label>
<div class="col-sm-8">
<?php
if ($aAttribute['readonly'] && $bIsActive)
{
echo $aAttribute['value'];
}
else
{
switch ($aAttribute['inputtype']){
case 'singleselect': echo "<select class='form-control' id='{$aAttribute['name']}' name='{$aAttribute['name']}'>";
foreach($aAttribute['options'] as $sOptionvalue=>$sOptiontext)
{
echo "<option value='{$sOptionvalue}' ";
if ($aAttribute['value']==$sOptionvalue)
{
echo " selected='selected' ";
}
echo ">{$sOptiontext}</option>";
}
echo "</select>";
break;
case 'text':?> <input type='text' class="form-control" id='<?php echo $aAttribute['name'];?>' name='<?php echo $aAttribute['name'];?>' value='<?php echo htmlspecialchars($aAttribute['value'],ENT_QUOTES, 'UTF-8');?>' />
<?php
break;
case 'integer':?> <input type='text' class="form-control" id='<?php echo $aAttribute['name'];?>' name='<?php echo $aAttribute['name'];?>' value='<?php echo $aAttribute['value'];?>' />
<?php
break;
case 'textarea':?> <textarea class="form-control" id='<?php echo $aAttribute['name'];?>' name='<?php echo $aAttribute['name'];?>'><?php echo $aAttribute['value'];?></textarea>
<?php
break;
}
}?>
</div>
</div>
<?php }?>
<fieldset>
<legend><?php echo $aAttribute['category'];?></legend>
<?php
}?>
<div class="form-group">
<label class="col-sm-4 control-label" for='<?php echo $aAttribute['name'];?>' title='<?php echo $aAttribute['help'];?>'><?php echo $aAttribute['caption'];
if ($aAttribute['i18n']==true) { ?> (<?php echo $aAttribute['language'] ?>)<?php }?>
</label>
<div class="col-sm-8">
<?php
if ($aAttribute['readonly'] && $bIsActive)
{
echo $aAttribute['value'];
}
else
{
switch ($aAttribute['inputtype']){
case 'singleselect': echo "<select class='form-control' id='{$aAttribute['name']}' name='{$aAttribute['name']}'>";
foreach($aAttribute['options'] as $sOptionvalue=>$sOptiontext)
{
echo "<option value='{$sOptionvalue}' ";
if ($aAttribute['value']==$sOptionvalue)
{
echo " selected='selected' ";
}
echo ">{$sOptiontext}</option>";
}
echo "</select>";
break;
case 'text':?> <input type='text' class="form-control" id='<?php echo $aAttribute['name'];?>' name='<?php echo $aAttribute['name'];?>' value='<?php echo htmlspecialchars($aAttribute['value'],ENT_QUOTES, 'UTF-8');?>' />
<?php
break;
case 'integer':?> <input type='text' class="form-control" id='<?php echo $aAttribute['name'];?>' name='<?php echo $aAttribute['name'];?>' value='<?php echo $aAttribute['value'];?>' />
<?php
break;
case 'textarea':?> <textarea class="form-control" id='<?php echo $aAttribute['name'];?>' name='<?php echo $aAttribute['name'];?>'><?php echo $aAttribute['value'];?></textarea>
<?php
break;
}
}?>
</div>
</div>
<?php }?>

0 comments on commit 809a5da

Please sign in to comment.