Skip to content

Commit

Permalink
Fixed issue #6585: Displaying tokens for survey always show 25 entrie…
Browse files Browse the repository at this point in the history
…s even if you have less
  • Loading branch information
c-schmitz committed Sep 25, 2012
1 parent a211996 commit 98bbc80
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions application/controllers/admin/tokens.php
Expand Up @@ -385,6 +385,10 @@ function getTokens_json($iSurveyId)
$aData = new stdClass;
$aData->page = $page;
$aData->records = Tokens_dynamic::model($iSurveyId)->count();
if ($limit>$aData->records)
{
$limit=$aData->records;
}
$aData->total = ceil($aData->records / $limit);

Yii::app()->loadHelper("surveytranslator");
Expand Down Expand Up @@ -2269,6 +2273,7 @@ function _handletokenform($iSurveyId, $subaction, $iTokenId="")
$aAdditionalAttributeFields = $thissurvey['attributedescriptions'];
$aTokenFieldNames=Yii::app()->db->getSchema()->getTable("{{tokens_$iSurveyId}}",true);
$aTokenFieldNames=array_keys($aTokenFieldNames->columns);
$aData['attrfieldnames']=array();
foreach ($aAdditionalAttributeFields as $sField=>$aData)
{
if (in_array($sField,$aTokenFieldNames))
Expand Down

0 comments on commit 98bbc80

Please sign in to comment.