Skip to content

Commit

Permalink
Dev #T1052: Group Summary: Move check logic and export under tools (#…
Browse files Browse the repository at this point in the history
…1990)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
  • Loading branch information
gabrieljenik and encuestabizdevgit committed Aug 11, 2021
1 parent 248cf10 commit 6894a81
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php if($hasSurveyContentReadPermission): ?>
<!-- Check survey logic -->
<li>
<a class="pjax" href="<?php echo Yii::App()->createUrl("admin/expressions/sa/survey_logic_file/sid/{$surveyid}/gid/{$gid}/"); ?>">
<span class="icon-expressionmanagercheck"></span>
<?php eT("Check logic"); ?>
</a>
</li>
<?php endif; ?>

<?php if($hasSurveyContentExportPermission):?>
<!-- Export -->
<li>
<a href="<?php echo Yii::App()->createUrl("admin/export/sa/group/surveyid/$surveyid/gid/$gid");?>">
<span class="icon-export"></span>
<?php eT("Export"); ?>
</a>
</li>
<?php endif; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@
$this->render('includes/previewSurveyAndGroupButtons_view', get_defined_vars());
?>

<!-- Check survey logic -->
<?php if($hasSurveyContentReadPermission): ?>
<a class="btn btn-default pjax" href="<?php echo Yii::App()->createUrl("admin/expressions/sa/survey_logic_file/sid/{$surveyid}/gid/{$gid}/"); ?>" role="button">
<span class="icon-expressionmanagercheck"></span>
<?php eT("Check logic"); ?>
</a>
<?php endif; ?>
<?php
// Tools dropdown button
$toolsDropdownItems = $this->render('includes/editGroupToolsDropdownItems', get_defined_vars(), true);
if (!empty(trim($toolsDropdownItems))):
?>
<!-- Tools -->
<div class="btn-group hidden-xs">

<?php if($hasSurveyContentExportPermission):?>
<!-- Export -->
<a class="btn btn-default " href="<?php echo Yii::App()->createUrl("admin/export/sa/group/surveyid/$surveyid/gid/$gid");?>" role="button">
<span class="icon-export"></span>
<?php eT("Export"); ?>
</a>
<?php endif; ?>
<!-- Main button dropdown -->
<button id="ls-question-group-tools-button" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="icon-tools" ></span>
<?php eT('Tools'); ?>&nbsp;<span class="caret"></span>
</button>

<!-- dropdown -->
<ul class="dropdown-menu">
<?= $toolsDropdownItems ?>
</ul>
</div>
<?php endif; ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php if($hasSurveyContentReadPermission): ?>
<!-- Check survey logic -->
<li>
<a class="pjax" href="<?php echo Yii::App()->createUrl("admin/expressions/sa/survey_logic_file/sid/{$surveyid}/gid/{$gid}/"); ?>">
<span class="icon-expressionmanagercheck"></span>
<?php eT("Check logic"); ?>
</a>
</li>
<?php endif; ?>

<?php if($hasSurveyContentExportPermission):?>
<!-- Export -->
<li>
<a href="<?php echo Yii::App()->createUrl("admin/export/sa/group/surveyid/$surveyid/gid/$gid");?>">
<span class="icon-export"></span>
<?php eT("Export"); ?>
</a>
</li>
<?php endif; ?>

<?php if($hasSurveyContentDeletePermission):?>
<!-- Delete -->
<?php if( $oSurvey->active != "Y" ):?>
<?php if(is_null($condarray)):?>
<?php // can delete group and question ?>
<li>
<a href="#" onclick="return false;"
data-toggle="modal"
data-target="#confirmation-modal"
data-onclick='(function() { <?php echo convertGETtoPOST(Yii::app()->createUrl("questionGroupsAdministration/delete/", ["asJson" => true, "surveyid" => $surveyid, "gid"=>$gid])); ?> })'
data-message="<?php eT("Deleting this group will also delete any questions and answers it contains. Are you sure you want to continue?","js"); ?>"
>
<span class="fa fa-trash"></span>
<?php eT("Delete"); ?>
</a>
</li>
<?php else: ?>
<?php // there is at least one question having a condition on its content ?>
<li class="disabled">
<a class="btntooltip" disabled data-toggle="tooltip" data-placement="bottom" title="<?php eT("Impossible to delete this group because there is at least one question having a condition on its content"); ?>" >
<span class="fa fa-trash"></span>
<?php eT("Delete"); ?>
</a>
</li>
<?php endif; ?>
<?php else:?>
<!-- Activated -->
<li class="disabled">
<a class="btntooltip" disabled data-toggle="tooltip" data-placement="bottom" title="<?php eT("You can't delete this question group because the survey is currently active."); ?>" >
<span class="fa fa-trash"></span>
<?php eT("Delete"); ?>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,23 @@
$this->render('includes/previewSurveyAndGroupButtons_view', get_defined_vars());
?>

<!-- Edit button -->
<?php if($hasSurveyContentUpdatePermission): ?>
<a class="btn btn-success pjax" href="<?php echo Yii::App()->createUrl("questionGroupsAdministration/edit/surveyid/{$surveyid}/gid/{$gid}/"); ?>" role="button">
<span class="icon-edit"></span>
<?php eT("Edit");?>
</a>
<?php endif; ?>
<?php
// Tools dropdown button
$toolsDropdownItems = $this->render('includes/groupToolsDropdownItems', get_defined_vars(), true);
if (!empty(trim($toolsDropdownItems))):
?>
<!-- Tools -->
<div class="btn-group hidden-xs">

<!-- Check survey logic -->
<?php if($hasSurveyContentReadPermission): ?>
<a class="btn btn-default pjax" href="<?php echo Yii::App()->createUrl("admin/expressions/sa/survey_logic_file/sid/{$surveyid}/gid/{$gid}/"); ?>" role="button">
<span class="icon-expressionmanagercheck"></span>
<?php eT("Check logic"); ?>
</a>
<?php endif; ?>
<!-- Main button dropdown -->
<button id="ls-question-group-tools-button" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="icon-tools" ></span>
<?php eT('Tools'); ?>&nbsp;<span class="caret"></span>
</button>

<?php if($hasSurveyContentExportPermission):?>
<!-- Export -->
<a class="btn btn-default " href="<?php echo Yii::App()->createUrl("admin/export/sa/group/surveyid/$surveyid/gid/$gid");?>" role="button">
<span class="icon-export"></span>
<?php eT("Export"); ?>
</a>
<!-- dropdown -->
<ul class="dropdown-menu">
<?= $toolsDropdownItems ?>
</ul>
</div>
<?php endif; ?>

<?php if($hasSurveyContentDeletePermission):?>
<!-- Delete -->
<?php if( $oSurvey->active != "Y" ):?>
<?php if(is_null($condarray)):?>
<!-- can delete group and question -->
<button
class="btn btn-danger"
data-toggle="modal"
data-target="#confirmation-modal"
data-onclick='(function() { <?php echo convertGETtoPOST(Yii::app()->createUrl("questionGroupsAdministration/delete/", ["asJson" => true, "surveyid" => $surveyid, "gid"=>$gid])); ?> })'
data-message="<?php eT("Deleting this group will also delete any questions and answers it contains. Are you sure you want to continue?","js"); ?>"
>
<span class="fa fa-trash"></span>
<?php eT("Delete"); ?>
</button>
<?php else: ?>
<!-- there is at least one question having a condition on its content -->
<button type="button" class="btn btn-danger btntooltip" disabled data-toggle="tooltip" data-placement="bottom" title="<?php eT("Impossible to delete this group because there is at least one question having a condition on its content"); ?>" >
<span class="fa fa-trash"></span>
<?php eT("Delete"); ?>
</a>
<?php endif; ?>
<?php else:?>
<!-- Activated -->
<button type="button" class="btn btn-danger btntooltip" disabled data-toggle="tooltip" data-placement="bottom" title="<?php eT("You can't delete this question group because the survey is currently active."); ?>" >
<span class="fa fa-trash"></span>
<?php eT("Delete"); ?>
</button>
<?php endif; ?>
<?php endif; ?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Edit button -->
<?php if($hasSurveyContentUpdatePermission): ?>
<a class="btn btn-success pjax" href="<?php echo Yii::App()->createUrl("questionGroupsAdministration/edit/surveyid/{$surveyid}/gid/{$gid}/"); ?>" role="button">
<span class="icon-edit"></span>
<?php eT("Edit");?>
</a>
<?php endif; ?>

0 comments on commit 6894a81

Please sign in to comment.