From 17b8dd68b8c398db8f167b6238b003a588e94745 Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Wed, 18 Dec 2013 12:00:20 +0100 Subject: [PATCH] Fixed issue #08461: Unable to filter by Email Status inside Token view --- application/controllers/admin/tokens.php | 7 +++---- application/helpers/common_helper.php | 5 +++++ application/views/admin/token/browse.php | 11 ++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/application/controllers/admin/tokens.php b/application/controllers/admin/tokens.php index 43afe5d8802..091493fe6cd 100644 --- a/application/controllers/admin/tokens.php +++ b/application/controllers/admin/tokens.php @@ -477,7 +477,8 @@ function getTokens_json($iSurveyId, $search = null) } $aData->rows[] = $aRowToAdd; } - + viewHelper::disableHtmlLogging(); + header("Content-type: application/json"); echo ls_json_encode($aData); } @@ -487,7 +488,6 @@ function getSearch_json($iSurveyId) $searchcondition = urldecode($searchcondition); $finalcondition = array(); $condition = explode("||", $searchcondition); - return $this->getTokens_json($iSurveyId, $condition); } @@ -589,9 +589,8 @@ function editToken($iSurveyId) $this->getController()->error(sprintf($clang->gT('%s cannot be left empty'), $desc['description'])); $aData[$attr_name] = Yii::app()->request->getPost($attr_name); } - echo ls_json_encode(var_export($aData)); $token = Token::create($surveyId); - $token->setAttributes($aData, false); + $token->setAttributes($aData, false); echo $token->save(); } elseif ($sOperation == 'del' && Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'update')) diff --git a/application/helpers/common_helper.php b/application/helpers/common_helper.php index 1f207b9d504..9cf1609a851 100644 --- a/application/helpers/common_helper.php +++ b/application/helpers/common_helper.php @@ -5464,6 +5464,11 @@ function getTokenFieldsAndNames($surveyid, $bOnlyAttributes = false) 'mandatory'=>'N', 'showregister'=>'Y' ), + 'emailstatus'=>array( + 'description'=>$clang->gT("Email status"), + 'mandatory'=>'N', + 'showregister'=>'N' + ), 'token'=>array( 'description'=>$clang->gT('Token'), 'mandatory'=>'N', diff --git a/application/views/admin/token/browse.php b/application/views/admin/token/browse.php index 7374fc3bc92..cb950272858 100644 --- a/application/views/admin/token/browse.php +++ b/application/views/admin/token/browse.php @@ -20,6 +20,7 @@ // Don't add id : because we don't really need it. This different from columnNames (no action). // TODO: Merge columnNames and aTokenColumns : need more option (name,index,search, type, editable ...) $aTokenColumns=getTokenFieldsAndNames($surveyid,false); + tracevar($aTokenColumns); $aNotQuickFilter=array('tid','emailstatus','sent','remindersent','remindercount','completed','usesleft','validfrom','validuntil'); foreach($aTokenColumns as $aTokenColumn => &$aTokenInformation) { @@ -156,15 +157,15 @@