Skip to content

Commit

Permalink
Fixed issue: Unable to add answer options/subquestions or to edit quotas
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Jun 12, 2015
1 parent 74eb721 commit cf24fe2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions application/controllers/admin/quotas.php
Expand Up @@ -47,7 +47,6 @@ private function _getData($iSurveyId)
{
// Set the variables in an array
$aData['iSurveyId'] = $aData['surveyid'] = $iSurveyId;
$aData['clang'] = $this->getController()->lang;
$aData['sBaseLang'] = Survey::model()->findByPk($iSurveyId)->language;
$aData['aLangs'] = Survey::model()->findByPk($iSurveyId)->additionalLanguages;
array_unshift($aData['aLangs'], $aData['sBaseLang']);
Expand All @@ -61,7 +60,6 @@ private function _getData($iSurveyId)

private function _checkPermissions($iSurveyId, $sPermission)
{
$clang=$this->getController()->lang;
if (!empty($sPermission) && !(Permission::model()->hasSurveyPermission($iSurveyId, 'quotas', $sPermission))) {
Yii::app()->session['flashmessage'] =gT('Access denied!');
$this->_redirectToIndex($iSurveyId);
Expand All @@ -70,7 +68,6 @@ private function _checkPermissions($iSurveyId, $sPermission)

function _redirectToIndex($iSurveyId)
{
$clang=$this->getController()->lang;
if(Permission::model()->hasSurveyPermission($iSurveyId, 'quotas','read'))
{
$this->getController()->redirect($this->getController()->createUrl("/admin/quotas/sa/index/surveyid/$iSurveyId"));
Expand All @@ -94,7 +91,6 @@ function index($iSurveyId, $quickreport = false)
$aViewUrls[] = 'viewquotas_view';
}

$clang = $aData['clang'];
$totalquotas = 0;
$totalcompleted = 0;
$csvoutput = array();
Expand Down Expand Up @@ -342,7 +338,6 @@ function editquota($iSurveyId)
$this->_checkPermissions($iSurveyId, 'update');
$aData = $this->_getData($iSurveyId);
$aLangs = $aData['aLangs'];
$clang = $aData['clang'];
$aViewUrls = array();

$aQuotaInfo = Quota::model()->findByPk(Yii::app()->request->getPost('quota_id'));
Expand Down Expand Up @@ -375,7 +370,6 @@ function new_answer($iSurveyId, $sSubAction = 'new_answer')
$this->_checkPermissions($iSurveyId, 'update');
$aData = $this->_getData($iSurveyId);
$sBaseLang = $aData['sBaseLang'];
$clang = $aData['clang'];
$aViewUrls = array();

if (($sSubAction == "new_answer" || ($sSubAction == "new_answer_two" && !isset($_POST['quota_qid']))) && Permission::model()->hasSurveyPermission($iSurveyId, 'quotas', 'create'))
Expand Down Expand Up @@ -428,7 +422,6 @@ function newquota($iSurveyId)
$iSurveyId = sanitize_int($iSurveyId);
$this->_checkPermissions($iSurveyId, 'create');
$aData = $this->_getData($iSurveyId);
$clang = $aData['clang'];

$aData['thissurvey'] = getSurveyInfo($iSurveyId);
$aData['langs'] = $aData['aLangs'];
Expand All @@ -451,7 +444,6 @@ function getQuotaAnswers($iQuestionId, $iSurveyId, $iQuotaId)
$iQuotaId = sanitize_int($iQuotaId);
$aData = $this->_getData($iSurveyId);
$sBaseLang = $aData['sBaseLang'];
$clang = $aData['clang'];
$this->_checkPermissions($iSurveyId, 'read');


Expand Down
2 changes: 1 addition & 1 deletion application/views/installer/precheck_view.php
Expand Up @@ -36,7 +36,7 @@ function dirReport($dir, $write)
?>
<div class="row">
<div class="span3">
<?php $this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep', 'clang')); ?>
<?php $this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep')); ?>
</div>
<div class="span9">
<h2><?php echo $title; ?></h2>
Expand Down

0 comments on commit cf24fe2

Please sign in to comment.