Skip to content

Commit

Permalink
dev: fixed commit 05b1d39
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed Apr 9, 2013
1 parent c85a705 commit 965fa89
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions application/helpers/common_helper.php
Expand Up @@ -331,10 +331,13 @@ function getSurveyList($returnarray=false, $surveyid=false)
$clang = new Limesurvey_lang(isset(Yii::app()->session['adminlang']) ? Yii::app()->session['adminlang'] : 'en');

if(is_null($cached)) {
if (!hasGlobalPermission('USER_RIGHT_SUPERADMIN'))
$surveyidresult = Survey::model()->permission(Yii::app()->user->getId())->with(array('languagesettings'=>array('condition'=>'surveyls_language=language')))->findAll();
else
$surveyidresult = Survey::model()->with(array('languagesettings'=>array('condition'=>'surveyls_language=language')))->findAll();
$args = array('order'=>'surveyls_title');
if (!Permission::model()->hasGlobalPermission('superadmin','read'))
{
$surveyidresult = Survey::model()->permission(Yii::app()->user->getId())->with(array('languagesettings'=>array('condition'=>'surveyls_language=language')))->findAll($args);
} else {
$surveyidresult = Survey::model()->with(array('languagesettings'=>array('condition'=>'surveyls_language=language')))->findAll($args);
}

$surveynames = array();
foreach ($surveyidresult as $result)
Expand Down

0 comments on commit 965fa89

Please sign in to comment.