Skip to content

Commit

Permalink
Fixed issue #14437: Statistics - Clear button not working
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jan 22, 2019
1 parent 1a777fe commit c3198cc
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions application/views/admin/responses/browsemenubar_view.php
Expand Up @@ -177,45 +177,39 @@ class="btn btn-default selector--ConfirmModal">
<span class="fa fa-floppy-o"></span>
<?php eT("Save");?>
</a>
<?php /*
<a class="btn btn-default" href="#" role="button" id="save-and-close-button">
<span class="fa fa-saved"></span>
<?php eT("Save and close");?>
</a>
*/ ?>
<?php endif;?>

<?php if(isset($menu['export'])): ?>
<a class="btn btn-success" href="#" role="button" id="save-button">
<a class="btn btn-success" href="#" role="button" id="export-button">
<span class="fa fa-download-alt"></span>
<?php eT("Export");?>
</a>
<?php endif;?>

<?php if(isset($menu['import'])): ?>
<a class="btn btn-success" href="#" role="button" id="save-button">
<a class="btn btn-success" href="#" role="button" id="import-button">
<span class="fa fa-upload"></span>
<?php eT("Import");?>
</a>
<?php endif;?>

<?php if(isset($menu['stats'])):?>
<?php if (isset($menu['expertstats']) && $menu['expertstats'] = true):?>
<a class="btn btn-info" href="<?php echo App()->createUrl('/admin/statistics/sa/index/surveyid/'.$surveyid); ?>" role="" id="">
<a class="btn btn-info" href="<?php echo App()->createUrl('/admin/statistics/sa/index/surveyid/'.$surveyid); ?>" role="" id="expert-mode">
<span class="fa fa-bar-chart"></span>
<?php eT("Expert mode"); ?>
</a>
<?php else: ?>
<a class="btn btn-info" href="<?php echo App()->createUrl('/admin/statistics/sa/simpleStatistics/surveyid/'.$surveyid); ?>" role="" id="">
<a class="btn btn-info" href="<?php echo App()->createUrl('/admin/statistics/sa/simpleStatistics/surveyid/'.$surveyid); ?>" role="" id="simple-mode">
<span class="fa fa-bar-chart"></span>
<?php eT("Simple mode"); ?>
</a>
<a class="btn btn-success" href="#" role="button" id="save-button">
<a class="btn btn-success" href="#" role="button" id="view-button">
<span class="fa"></span>
<?php eT("View statistics"); ?>
</a>

<a class="btn btn-default" href="#" role="button" id="save-button" onclick="window.open('<?php echo Yii::app()->getController()->createUrl("admin/statistics/sa/index/surveyid/$surveyid"); ?>', '_top')">
<a class="btn btn-default" href="#" role="button" id="clear-button" onclick="window.open('<?php echo Yii::app()->getController()->createUrl("admin/statistics/sa/index/surveyid/$surveyid"); ?>', '_top')">
<span class="fa fa-refresh text-success"></span>
<?php eT("Clear"); ?>
</a>
Expand Down

5 comments on commit c3198cc

@lemeur
Copy link
Collaborator

@lemeur lemeur commented on c3198cc Jan 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups, this commits breaks Result Export. see https://bugs.limesurvey.org/view.php?id=14450

===========
Buttons ids were renamed from save-button to export-button, ... but assets/packages/adminbasics/build/adminbasics.js was not udated accordingly.

Should we fix assets/packages/adminbasics/build/adminbasics.js in order to match the new button Ids from browsemenubar_view.php ?

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adminbasics.js must use data or other attribute. Usage of is is really a bad things to do …

@lemeur
Copy link
Collaborator

@lemeur lemeur commented on c3198cc Jan 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so we should either revert the button name to save-button for the export (line 183)
Or
Fix the Javascript code either in
./packages/adminbasics/src/parts/save.js
Or in a new ./packages/adminbasics/src/parts/export.js

I'm not enough familiar with the LS3.x codebase to decide...

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have issue about gulp in LimeSurvey and gulp on Fedora 29 … #1174 (comment)
But i can have a look Monday.

@Shnoulle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS : 4 buttons with same id , we have a lot of chance it work …

Please sign in to comment.