Skip to content

Commit

Permalink
Fixed issue #17655: Launch survey via token link : unclear icon (#2449)
Browse files Browse the repository at this point in the history
Dev: Use same icon than global view, review string
  • Loading branch information
Shnoulle committed Jun 28, 2022
1 parent cd72ec1 commit 79df71d
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions application/models/TokenDynamic.php
Expand Up @@ -625,7 +625,7 @@ public function getStandardColsForGrid()
array(
'header' => gT('Action'),
'class' => 'bootstrap.widgets.TbButtonColumn',
'template' => '{edit}{viewresponse}{spacerviewresponse}{previewsurvey}{previewsurveyspacer}{mail}{remind}{mailspacer}{viewparticipant}<span data-toggle="tooltip" title="' . gt('Delete survey participant') . '">{deletetoken}</span>{viewparticipantspacer}',
'template' => '{edit}{viewresponse}{spacerviewresponse}{previewsurvey}{launchsurvey}{previewsurveyspacer}{mail}{remind}{mailspacer}{viewparticipant}<span data-toggle="tooltip" title="' . gt('Delete survey participant') . '">{deletetoken}</span>{viewparticipantspacer}',
'htmlOptions' => array('class' => 'icon-btn-row'),
'buttons' => $this->getGridButtons(),
),
Expand Down Expand Up @@ -812,7 +812,19 @@ public function getGridButtons()
/* previewsurvey button */
$baseView = intval(Permission::model()->hasSurveyPermission(self::$sid, 'responses', 'create'));
$gridButtons['previewsurvey'] = array(
'label' => '<span class="sr-only">' . gT("Launch the survey with this participant") . '</span><span class="fa fa-eye" aria-hidden="true"></span>',
'label' => '<span class="sr-only">' . gT("Preview the survey with this participant") . '</span><span class="fa fa-eye" aria-hidden="true"></span>',
'imageUrl' => false,
'url' => 'App()->createUrl("/survey/index",array("sid"=>' . self::$sid . ',"token"=>$data->token,"newtest"=>"Y"));',
'options' => array(
'class' => "btn btn-default btn-sm",
'target' => "_blank",
'data-toggle' => "tooltip",
'title' => gT("Preview the survey with this participant")
),
'visible' => $baseView . ' && !$data->survey->isActive && !empty($data->token) && ( $data->completed == "N" || empty($data->completed) || $data->survey->alloweditaftercompletion == "Y")'
);
$gridButtons['launchsurvey'] = array(
'label' => '<span class="sr-only">' . gT("Launch the survey with this participant") . '</span><span class="fa fa-play" aria-hidden="true"></span>',
'imageUrl' => false,
'url' => 'App()->createUrl("/survey/index",array("sid"=>' . self::$sid . ',"token"=>$data->token,"newtest"=>"Y"));',
'options' => array(
Expand All @@ -821,7 +833,7 @@ public function getGridButtons()
'data-toggle' => "tooltip",
'title' => gT("Launch the survey with this participant")
),
'visible' => $baseView . ' && !empty($data->token) && ( $data->completed == "N" || empty($data->completed) || $data->survey->alloweditaftercompletion == "Y")'
'visible' => $baseView . ' && $data->survey->isActive && !empty($data->token) && ( $data->completed == "N" || empty($data->completed) || $data->survey->alloweditaftercompletion == "Y")'
);
$gridButtons['previewsurveyspacer'] = array(
'label' => '<span class="fa fa-eye text-muted" aria-hidden="true"></span>',
Expand Down

0 comments on commit 79df71d

Please sign in to comment.