Skip to content

Commit

Permalink
Fix surveyaction::getSurveys_json
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@11837 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Shitiz Garg committed Jan 2, 2012
1 parent 3085497 commit fd64297
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions application/controllers/admin/surveyaction.php
Expand Up @@ -715,7 +715,7 @@ public function getSurveys_json()
//!!! Is this even possible to execute?
if (empty(Yii::app()->session['USER_RIGHT_SUPERADMIN']))
$surveys->permission(Yii::app()->user->getId());
$surveys = $surveys->findAll();
$surveys = $surveys->with('languagesettings', 'owner')->findAll();

$aSurveyEntries->page = $page;
$aSurveyEntries->records = count($surveys);
Expand All @@ -724,6 +724,8 @@ public function getSurveys_json()
{
$aSurveyEntry = array();
$rows = $surveys[$j];
$rows = array_merge($rows->attributes, $rows->languagesettings->attributes, $rows->owner->attributes);

// Set status
if ($rows['active'] == "Y" && $rows['expires'] != '' && $rows['expires'] < date_shift(date("Y-m-d H:i:s"), "Y-m-d", Yii::app()->getConfig('timeadjust')))
{
Expand Down Expand Up @@ -797,8 +799,8 @@ public function getSurveys_json()
//Set Responses
if ($rows['active'] == "Y")
{
$partial = Survey_dynamics::model($rows['sid'])->countByAttributes(array('submitdate' => null));
$all = Survey_dynamics::model($rows['sid'])->count();
$partial = Survey_dynamic::model($rows['sid'])->countByAttributes(array('submitdate' => null));
$all = Survey_dynamic::model($rows['sid'])->count();

$aSurveyEntry[] = $all - $partial;
$aSurveyEntry[] = $partial;
Expand Down

0 comments on commit fd64297

Please sign in to comment.