Skip to content

Commit

Permalink
Dev: Fixed issue : edit default value need content update too
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Dec 6, 2018
1 parent 6796a5a commit c0acd62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions application/controllers/admin/questions.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ public function import()
*/
public function editdefaultvalues($surveyid, $gid, $qid)
{
if (!Permission::model()->hasSurveyPermission($surveyid, 'surveycontent', 'update')) {
Yii::app()->user->setFlash('error', gT("Access denied"));
$this->getController()->redirect(Yii::app()->request->urlReferrer);
}
$iSurveyID = (int) $surveyid;
$survey = Survey::model()->findByPk($iSurveyID);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@


<!-- Default Values -->
<?php if(Permission::model()->hasSurveyPermission($surveyid,'surveycontent','read') && $qtypes[$qrrow['type']]['hasdefaultvalues'] >0):?>
<?php if(Permission::model()->hasSurveyPermission($surveyid,'surveycontent','update') && $qtypes[$qrrow['type']]['hasdefaultvalues'] >0):?>
<a class="btn btn-default pjax" href="<?php echo $this->createUrl('admin/questions/sa/editdefaultvalues/surveyid/'.$surveyid.'/gid/'.$gid.'/qid/'.$qid); ?>" role="button">
<span class="icon-defaultanswers"></span>
<?php eT("Edit default answers"); ?>
Expand Down

0 comments on commit c0acd62

Please sign in to comment.