Skip to content

Commit

Permalink
Fixed issues with activated icons in survey bar even though survey wa…
Browse files Browse the repository at this point in the history
…s not active

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11122 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Oct 7, 2011
1 parent a51e4a0 commit 8075576
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions application/core/Survey_Common_Controller.php
Expand Up @@ -234,7 +234,7 @@ function _surveybar($surveyid,$gid=null)
$surveyinfo = $sumresult1->row_array();
$surveyinfo = array_map('FlattenText', $surveyinfo);
//$surveyinfo = array_map('htmlspecialchars', $surveyinfo);
$activated = $surveyinfo['active'];
$activated = ($surveyinfo['active']=='Y');

$js_admin_includes = $this->config->item("js_admin_includes");
$js_admin_includes[]=$this->config->item('generalscripts').'jquery/jquery.coookie.js';
Expand All @@ -252,7 +252,7 @@ function _surveybar($surveyid,$gid=null)
$data['surveyid']=$surveyid;

// ACTIVATE SURVEY BUTTON
$data['activated'] = ($activated=="Y") ? true : false;
$data['activated'] = $activated;
$data['imageurl'] = $this->config->item('imageurl');

$condition = array('sid' => $surveyid, 'parent_qid' => 0, 'language' => $baselang);
Expand All @@ -268,7 +268,7 @@ function _surveybar($surveyid,$gid=null)

// Start of suckerfish menu
// TEST BUTTON
if ($activated == "N")
if (!$activated)
{
$data['icontext']=$clang->gT("Test This Survey");
$data['icontext2']=$clang->gTview("Test This Survey");
Expand Down Expand Up @@ -356,7 +356,6 @@ function _surveybar($surveyid,$gid=null)
$data['GidPrev'] = $GidPrev = getGidPrevious($surveyid, $gid);

$data['GidNext'] = $GidNext = getGidNext($surveyid, $gid);
$data['activated'] = $activated;

$this->load->view("admin/survey/surveybar_view",$data);

Expand Down
6 changes: 3 additions & 3 deletions application/views/admin/survey/surveybar_view.php
Expand Up @@ -5,7 +5,7 @@
</div>
<div class='menubar-main'>
<div class='menubar-left'>
<?php if($activated == "N") { ?>
<?php if(!$activated) { ?>
<img src='<?php echo $imageurl;?>/inactive.png' alt='<?php echo $clang->gT("This survey is currently not active"); ?>' />
<?php if($canactivate) { ?>
<a href="#" onclick="window.open('<?php echo site_url("admin/survey/activate/$surveyid");?>', '_top')"
Expand Down Expand Up @@ -66,7 +66,7 @@
<img src='<?php echo $imageurl;?>/survey_security_30.png' name='SurveySecurity' alt=''/> <?php echo $clang->gT("Survey permissions");?></a></li>
<?php } ?>
<?php if ($surveycontent) {
if($activated == "Y") { ?>
if($activated) { ?>
<li><a href="#" onclick="alert('<?php echo $clang->gT("You can't reorder question groups if the survey is active.", "js");?>');" >
<img src='<?php echo $imageurl;?>/reorder_disabled_30.png' name='translate' alt=''/> <?php echo $clang->gT("Reorder question groups");?></a></li>
<?php } elseif ($groupsum) { ?>
Expand Down Expand Up @@ -250,7 +250,7 @@

<?php if(bHasSurveyPermission($surveyid,'surveycontent','create'))
{
if ($activated == "Y")
if ($activated)
{ ?>
<img src='<?php echo $this->config->item('imageurl'); ?>/add_disabled.png' title='' alt='<?php echo $clang->gT("Disabled"); ?> - <?php echo $clang->gT("This survey is currently active."); ?>'
name='AddNewGroup' width="40" height="40"/>
Expand Down

0 comments on commit 8075576

Please sign in to comment.