Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:LimeSurvey/LimeSurvey into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Aug 17, 2015
2 parents 7bf52d0 + 3b9eb48 commit fa09927
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions application/controllers/RegisterController.php
Expand Up @@ -421,20 +421,20 @@ private function display($iSurveyId)
$aData['thissurvey']=getSurveyInfo($iSurveyId,$sLanguage);
$sTemplate=Template::getTemplatePath($aData['thissurvey']['template']);
Yii::app()->setConfig('surveyID',$iSurveyId);//Needed for languagechanger
$aData['languagechanger']=makeLanguageChangerSurvey($sLanguage);
$aData['sitename']=App()->name;
$aData['aRegisterErrors']=$this->aRegisterErrors;
$aData['sMessage']=$this->sMessage;

sendCacheHeaders();
doHeader();
$aViewData['sTemplate']=$sTemplate;
$aViewData['aData']=$aData;
if(!$this->sMessage){
$aData['languagechanger']=makeLanguageChangerSurvey($sLanguage);
$aViewData['content']=self::getRegisterForm($iSurveyId);
}else{
$aViewData['content']=templatereplace($this->sMessage);
}
$aViewData['aData']=$aData;
// Test if we come from index or from register
if(empty(App()->clientScript->scripts)){
App()->getClientScript()->registerPackage('jqueryui');
Expand Down
4 changes: 2 additions & 2 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -3223,9 +3223,9 @@ static function StartSurvey(
// }
// switch ($knownVar['type']) {
// case 'D': //DATE
// if (trim($value) == "") {
// if (trim($value) == "" | $value=='INVALID') {
// $value = null;
// } elseif ($value != 'INVALID') {
// } else {
// $dateformatdatat = getDateFormatData($LEM->surveyOptions['surveyls_dateformat']);
// $datetimeobj = new Date_Time_Converter($value, $dateformatdatat['phpdate']);
// $value = $datetimeobj->convert("Y-m-d H:i");
Expand Down
13 changes: 10 additions & 3 deletions application/helpers/remotecontrol/remotecontrol_handle.php
Expand Up @@ -1770,9 +1770,10 @@ public function list_groups($sSessionKey, $iSurveyID)
* @param int $iLimit Number of participants to return
* @param bool $bUnused If you want unused tokens, set true
* @param bool|array $aAttributes The extented attributes that we want
* @param array $aConditions Optional conditions to limit the list, e.g. with array('email' => 'info@example.com')
* @return array The list of tokens
*/
public function list_participants($sSessionKey, $iSurveyID, $iStart=0, $iLimit=10, $bUnused=false,$aAttributes=false)
public function list_participants($sSessionKey, $iSurveyID, $iStart=0, $iLimit=10, $bUnused=false, $aAttributes=false, $aConditions=array() )
{
if ($this->_checkSessionKey($sSessionKey))
{
Expand All @@ -1785,10 +1786,16 @@ public function list_participants($sSessionKey, $iSurveyID, $iStart=0, $iLimit=1
if(!tableExists("{{tokens_$iSurveyID}}"))
return array('status' => 'Error: No token table');

$aAttributeValues = array();
if (count($aConditions)) {
$aConditionFields = array_flip(Token::model($iSurveyID)->getMetaData()->tableSchema->columnNames);
$aAttributeValues = array_intersect_key($aConditions, $aConditionFields);
}

if($bUnused)
$oTokens = Token::model($iSurveyID)->incomplete()->findAll(array('limit' => $iLimit, 'offset' => $iStart));
$oTokens = Token::model($iSurveyID)->incomplete()->findAllByAttributes($aAttributeValues, array('order' => 'tid', 'limit' => $iLimit, 'offset' => $iStart));
else
$oTokens = Token::model($iSurveyID)->findAll(array('limit' => $iLimit, 'offset' => $iStart));
$oTokens = Token::model($iSurveyID)->findAllByAttributes($aAttributeValues, array('order' => 'tid', 'limit' => $iLimit, 'offset' => $iStart));

if(count($oTokens)==0)
return array('status' => 'No Tokens found');
Expand Down

0 comments on commit fa09927

Please sign in to comment.