Skip to content

Commit

Permalink
Fixed issue #6567: Performance issue
Browse files Browse the repository at this point in the history
Dev Removed unnecessary processing giving display participant better load times
  • Loading branch information
aniesshsethh committed Oct 30, 2012
1 parent 74f8a59 commit 7a08f15
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions application/controllers/admin/participantsaction.php
Expand Up @@ -840,7 +840,7 @@ function getParticipantsResults_json()
$page = Yii::app()->request->getPost('page');
$limit = Yii::app()->request->getPost('rows');
$page=($page) ? $page : 1;
$limit=($limit) ? $limit : 25;
$limit=($limit) ? $limit : 25;

$attid = ParticipantAttributeNames::model()->getVisibleAttributes();
$participantfields = array('participant_id', 'can_edit', 'firstname', 'lastname', 'email', 'blacklisted', 'survey', 'language', 'owner_uid');
Expand Down Expand Up @@ -1062,8 +1062,7 @@ function subval_sort($a, $subkey, $order)
{
$username = User::model()->getName($row['owner_uid']); //for conversion of uid to human readable names
$surveycount = Participants::model()->getSurveyCount($row['participant_id']);
$sortablearray[$i] = array($row['participant_id'], "true", $row['firstname'], $row['lastname'], $row['email'], $row['blacklisted'], $surveycount, $row['language'], $username[0]['full_name']); // since it's the admin he has access to all editing on the participants inspite of what can_edit option is
$attributes = ParticipantAttributeNames::model()->getParticipantVisibleAttribute($row['participant_id']);
$sortablearray[$i] = array($row['participant_id'], "true", $row['firstname'], $row['lastname'], $row['email'], $row['blacklisted'], $surveycount, $row['language'], $username[0]['full_name']); // since it's the admin he has access to all editing on the participants inspite of what can_edit option is
foreach ($attid as $iAttributeId)
{
$answer = ParticipantAttributeNames::model()->getAttributeValue($row['participant_id'], $iAttributeId['attribute_id']);
Expand Down Expand Up @@ -1112,7 +1111,6 @@ function subval_sort($a, $subkey, $order)
$surveycount = Participants::model()->getSurveyCount($row['participant_id']);
$ownername = User::model()->getName($row['owner_uid']); //for conversion of uid to human readable names
$sortablearray[$i] = array($row['participant_id'], $row['can_edit'], $row['firstname'], $row['lastname'], $row['email'], $row['blacklisted'], $surveycount, $row['language'], $ownername[0]['full_name']);
$attributes = ParticipantAttributeNames::model()->getParticipantVisibleAttribute($row['participant_id']);
foreach ($attid as $iAttributeId)
{
$answer = ParticipantAttributeNames::model()->getAttributeValue($row['participant_id'], $iAttributeId['attribute_id']);
Expand Down

0 comments on commit 7a08f15

Please sign in to comment.