diff --git a/application/controllers/admin/browse.php b/application/controllers/admin/browse.php index e37ea03812d..e7672f8b08f 100644 --- a/application/controllers/admin/browse.php +++ b/application/controllers/admin/browse.php @@ -423,8 +423,28 @@ public function index($iSurveyId) } $clang = $aData['clang']; - if(isset($aData['all'])) + $aData['num_total_answers'] = Survey_dynamic::model($iSurveyId)->count(); + $aData['num_completed_answers'] = Survey_dynamic::model($iSurveyId)->count('submitdate IS NOT NULL'); + + $aViewUrls[] = 'browseindex_view'; + $this->_renderWrappedTemplate('',$aViewUrls, $aData); + } + function browse($iSurveyId) + { + $aData = $this->_getData($iSurveyId); + extract($aData); + $aViewUrls = array(); + $oBrowseLanguage = new Limesurvey_lang($aData['language']); + + /** + * fnames is used as informational array + * it containts + * $fnames[] = array(, , , , ); + */ + if (Yii::app()->request->getPost('sql')) { + $aViewUrls[] = 'browseallfiltered_view'; + } //add token to top of list if survey is not private if ($aData['surveyinfo']['anonymized'] == "N" && tableExists('tokens_' . $iSurveyId)) //add token to top of list if survey is not private { @@ -578,17 +598,8 @@ public function index($iSurveyId) } $aViewUrls[] = 'browseallfooter_view'; - } - else - { - $aData['num_total_answers'] = Survey_dynamic::model($iSurveyId)->count(); - $aData['num_completed_answers'] = Survey_dynamic::model($iSurveyId)->count('submitdate IS NOT NULL'); - - $aViewUrls[] = 'browseindex_view'; - } $this->_renderWrappedTemplate('',$aViewUrls, $aData); } - public function time($iSurveyId) { $aData = $this->_getData(array('iSurveyId' => $iSurveyId)); @@ -611,7 +622,7 @@ public function time($iSurveyId) } } - $fields = createTimingsFieldMap($iSurveyId, 'full'); + $fields = createTimingsFieldMap($iSurveyId, 'full',true,false,$aData['language']); $clang = $aData['clang']; foreach ($fields as $fielddetails) @@ -654,7 +665,7 @@ public function time($iSurveyId) $limit = Yii::app()->request->getParam('limit', 50); //LETS COUNT THE DATA - $oCriteria = new CdbCritera(); + $oCriteria = new CdbCriteria(); $oCriteria->select = 'tid'; $oCriteria->join = "INNER JOIN {{survey_{$iSurveyId}}} ON {{survey_{$iSurveyId}_timings}}.id={{survey_{$iSurveyId}}}.id"; $oCriteria->condition = 'submitdate IS NOT NULL'; @@ -666,7 +677,7 @@ public function time($iSurveyId) } //NOW LETS SHOW THE DATA - $oCriteria = new CdbCritera(); + $oCriteria = new CdbCriteria(); $oCriteria->join = "INNER JOIN {{survey_{$iSurveyId}}} ON {{survey_{$iSurveyId}_timings}}.id = {{survey_{$iSurveyId}}}.id"; $oCriteria->condition = 'submitdate IS NOT NULL'; $oCriteria->order = "{{survey_{$iSurveyId}}}.id"; diff --git a/application/views/admin/browse/browsemenubar_view.php b/application/views/admin/browse/browsemenubar_view.php index dce4cc684a2..13d7a6a5595 100644 --- a/application/views/admin/browse/browsemenubar_view.php +++ b/application/views/admin/browse/browsemenubar_view.php @@ -15,12 +15,12 @@ <?php $clang->eT("Show summary information"); ?> findByPk($surveyid)->additionalLanguages) == 0) { ?> - + <?php $clang->eT("Display Responses"); ?> - " accesskey='b' id='browseresponses'> + " accesskey='b' id='browseresponses'> <?php $clang->eT("Display Responses"); ?>
eT("Please select a language:"); ?>
    @@ -30,7 +30,7 @@
- + <?php $clang->eT("Display Last 50 Responses"); ?> statistics.png' alt='eT("Get statistics from these responses"); ?>' /> - + <?php $clang->eT("Get time statistics from these responses"); ?>