Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/Yii' into Yii
Browse files Browse the repository at this point in the history
  • Loading branch information
trougakoss committed Jul 25, 2012
2 parents a0dcbad + e72003b commit c0f63bf
Show file tree
Hide file tree
Showing 12 changed files with 511 additions and 186 deletions.
8 changes: 4 additions & 4 deletions application/controllers/admin/conditionsaction.php
Expand Up @@ -792,18 +792,18 @@ function index($subaction, $surveyid=null, $gid=null, $qid=null)
$x_axis[$frow['title']]=$frow['question'];
}

foreach ($y_axis_db->readAll() as $arow)
foreach ($y_axis_db->readAll() as $yrow)
{
foreach($x_axis as $key=>$val)
{
$shortquestion=$rows['title'].":{$arows['title']}:$key: [".strip_tags($arows['question']). "][" .strip_tags($val). "] " . flattenText($rows['question']);
$cquestions[]=array($shortquestion, $rows['qid'], $rows['type'], $rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title']."_".$key);
$shortquestion=$rows['title'].":{$yrow['title']}:$key: [".strip_tags($yrow['question']). "][" .strip_tags($val). "] " . flattenText($rows['question']);
$cquestions[]=array($shortquestion, $rows['qid'], $rows['type'], $rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$yrow['title']."_".$key);

if ($rows['type'] == ":")
{
for($ii=$minvalue; $ii<=$maxvalue; $ii+=$stepvalue)
{
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title']."_".$key, $ii, $ii);
$canswers[]=array($rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$yrow['title']."_".$key, $ii, $ii);
}
}
}
Expand Down
11 changes: 1 addition & 10 deletions application/controllers/admin/expressions.php
Expand Up @@ -24,16 +24,7 @@ function index()
<script src="<?php echo Yii::app()->getConfig('generalscripts') . 'jquery/jquery.js'; ?>"></script>
<script src="<?php echo Yii::app()->getConfig('generalscripts') . 'expressions/em_javascript.js'; ?>" /></script>
<script src="<?php echo Yii::app()->getConfig('generalscripts') . 'survey_runtime.js'; ?>" /></script>
<style type="text/css">
<!--
.error {
background-color: #ff0000;
}
.ok {
background-color: #00ff00
}
-->
</style>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->getConfig('adminstyleurl')."adminstyle.css"; ?>" />
</head>
<body <?php $this->_printOnLoad(Yii::app()->request->getQuery('sa', 'index'))?>>
<?php
Expand Down
21 changes: 10 additions & 11 deletions application/controllers/admin/participantsaction.php
Expand Up @@ -109,27 +109,26 @@ function displayParticipants()
$urlSearch=Yii::app()->request->getQuery('searchurl');
$urlSearch=!empty($urlSearch) ? "getParticipantsResults_json/search/$urlSearch" : "getParticipants_json";

if (Yii::app()->session['USER_RIGHT_SUPERADMIN'])
{
$aSurveyNames = Surveys_languagesettings::model()->with('survey', 'owner')->findAll('surveyls_language=:lang', array(':lang'=>$lang));
}
// otherwise owned by him
else
{
$aSurveyNames = Surveys_languagesettings::model()->with('survey', 'owner')->findAll('survey.owner_id=:uid AND surveyls_language=:lang',array('survey.uid'=>Yii::app()->session['loginID'], ':lang'=>$lang));
}
//Get list of surveys.
//Should be all surveys owned by user (or all surveys for super admin)
$surveys = Survey::model();
//!!! Is this even possible to execute?
if (empty(Yii::app()->session['USER_RIGHT_SUPERADMIN']))
$surveys->permission(Yii::app()->user->getId());

$aSurveyNames = $surveys->model()->with(array('languagesettings'=>array('condition'=>'surveyls_language=language'), 'owner'))->findAll();

/* Build a list of surveys that have tokens tables */
$tSurveyNames=array();
foreach($aSurveyNames as $row)
{
$bTokenExists = tableExists('{{tokens_' . $row['surveyls_survey_id'] . '}}');
$row = array_merge($row->attributes, $row->languagesettings[0]->attributes);
$bTokenExists = tableExists('{{tokens_' . $row['sid'] . '}}');
if ($bTokenExists) //If tokens table exists
{
$tSurveyNames[]=$row;
}
}

// data to be passed to view
$aData = array(
'names' => User::model()->findAll(),
Expand Down
2 changes: 1 addition & 1 deletion application/helpers/admin/activate_helper.php
Expand Up @@ -301,7 +301,7 @@ function activateSurvey($iSurveyID, $simulate = false)
$createsurvey[$arow['fieldname']] = "integer";
break;
case "N": //NUMERICAL
$createsurvey[$arow['fieldname']] = "float";
$createsurvey[$arow['fieldname']] = "decimal (30,10)";
break;
case "S": //SHORT TEXT
if (Yii::app()->db->driverName == 'mysql' || Yii::app()->db->driverName == 'mysqli') {$createsurvey[$arow['fieldname']] = "text";}
Expand Down

0 comments on commit c0f63bf

Please sign in to comment.