Display: Use new icons for survey tool

pull/5032/head
Yannick Warnier 11 months ago
parent 98334dc6f2
commit f197e33a7f
  1. 14
      public/main/survey/meeting.php
  2. 3
      public/main/survey/question.php
  3. 35
      public/main/survey/reporting.php
  4. 20
      public/main/survey/survey.lib.php
  5. 55
      public/main/survey/survey.php
  6. 91
      public/main/survey/surveyUtil.class.php
  7. 8
      public/main/survey/survey_list.php
  8. 8
      public/main/survey/survey_question.php

@ -4,6 +4,8 @@
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CSurvey; use Chamilo\CourseBundle\Entity\CSurvey;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Component\Utils\StateIcon;
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
@ -176,8 +178,8 @@ foreach ($questions as $item) {
$row = 2; $row = 2;
$column = 0; $column = 0;
$availableIcon = Display::return_icon('bullet_green.png', get_lang('Available')); $availableIcon = Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Available'));
$notAvailableIcon = Display::return_icon('bullet_red.png', get_lang('Not available')); $notAvailableIcon = Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Not available'));
foreach ($students as $studentId) { foreach ($students as $studentId) {
$userInfo = api_get_user_info($studentId); $userInfo = api_get_user_info($studentId);
@ -185,7 +187,7 @@ foreach ($students as $studentId) {
if ($userId == $studentId) { if ($userId == $studentId) {
if ('edit' !== $action) { if ('edit' !== $action) {
$name .= Display::url( $name .= Display::url(
Display::return_icon('edit.png', get_lang('Edit')), Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')),
$urlEdit $urlEdit
); );
} }
@ -263,16 +265,16 @@ if ('edit' === $action) {
$actions = ''; $actions = '';
if (api_is_allowed_to_edit()) { if (api_is_allowed_to_edit()) {
$actions .= Display::url( $actions .= Display::url(
Display::return_icon('edit.png', get_lang('Edit survey'), '', ICON_SIZE_MEDIUM), Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Edit survey')),
api_get_path(WEB_CODE_PATH).'survey/edit_meeting.php?'.api_get_cidreq().'&action=edit&survey_id='.$surveyId api_get_path(WEB_CODE_PATH).'survey/edit_meeting.php?'.api_get_cidreq().'&action=edit&survey_id='.$surveyId
); );
$actions .= Display::url( $actions .= Display::url(
Display::return_icon('delete.png', get_lang('Delete survey'), '', ICON_SIZE_MEDIUM), Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Delete survey')),
api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&action=delete&survey_id='.$surveyId, api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&action=delete&survey_id='.$surveyId,
['onclick' => 'javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('Delete survey').'?', ENT_QUOTES)).'\')) return false;'] ['onclick' => 'javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('Delete survey').'?', ENT_QUOTES)).'\')) return false;']
); );
$actions .= Display::url( $actions .= Display::url(
Display::return_icon('mail_send.png', get_lang('Publish'), '', ICON_SIZE_MEDIUM), Display::getMdiIcon(StateIcon::MAIL_NOTIFICATION, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Publish')),
api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&survey_id='.$surveyId api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&survey_id='.$surveyId
); );
} }

@ -3,6 +3,7 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
/** /**
* @author unknown, the initial survey that did not make it in 1.8 because of bad code * @author unknown, the initial survey that did not make it in 1.8 because of bad code
@ -83,7 +84,7 @@ $possible_types = [
$actions = '<div class="actions">'; $actions = '<div class="actions">';
$actions .= '<a href="'.$surveyUrl.'">'. $actions .= '<a href="'.$surveyUrl.'">'.
Display::return_icon('back.png', get_lang('Back to survey'), '', ICON_SIZE_MEDIUM).'</a>'; Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to survey')).'</a>';
$actions .= '</div>'; $actions .= '</div>';
// Checking if it is a valid type // Checking if it is a valid type
if (!in_array($_GET['type'], $possible_types)) { if (!in_array($_GET['type'], $possible_types)) {

@ -229,56 +229,31 @@ if ('overview' === $action) {
$html .= '<div class="survey-reports">'; $html .= '<div class="survey-reports">';
$html .= '<div class="list-group">'; $html .= '<div class="list-group">';
$html .= Display::url( $html .= Display::url(
Display::return_icon( Display::getMdiIcon('chart-line', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Questions\' overall report')).'<h4>'.get_lang('Questions\' overall report').'</h4><p>'.get_lang('Questions\' overall reportDetail').'</p>',
'survey_reporting_overall.png',
get_lang('Questions\' overall report'),
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('Questions\' overall report').'</h4><p>'.get_lang('Questions\' overall reportDetail').'</p>',
$url.'action=questionreport&survey_id='.$surveyId.'&single_page=1', $url.'action=questionreport&survey_id='.$surveyId.'&single_page=1',
['class' => 'list-group-item'] ['class' => 'list-group-item']
); );
$html .= Display::url( $html .= Display::url(
Display::return_icon( Display::getMdiIcon('chart-gantt', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Detailed report by question')).'<h4>'.get_lang('Detailed report by question').'</h4><p>'.get_lang('Detailed report by questionDetail').'</p>',
'survey_reporting_question.png',
get_lang('Detailed report by question'),
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('Detailed report by question').'</h4><p>'.get_lang('Detailed report by questionDetail').'</p>',
$url.'action=questionreport&survey_id='.$surveyId, $url.'action=questionreport&survey_id='.$surveyId,
['class' => 'list-group-item'] ['class' => 'list-group-item']
); );
$html .= Display::url( $html .= Display::url(
Display::return_icon( Display::getMdiIcon('chart-bar', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Detailed report by user')).'<h4>'.get_lang('Detailed report by user').'</h4><p>'.get_lang('Detailed report by userDetail').'</p>',
'survey_reporting_user.png',
get_lang('Detailed report by user'),
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('Detailed report by user').'</h4><p>'.get_lang('Detailed report by userDetail').'</p>',
$url.'action=userreport&survey_id='.$surveyId, $url.'action=userreport&survey_id='.$surveyId,
['class' => 'list-group-item'] ['class' => 'list-group-item']
); );
$html .= Display::url( $html .= Display::url(
Display::return_icon( Display::getMdiIcon('chart-areaspline', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Comparative report')).'<h4>'.get_lang('Comparative report').'</h4><p>'.get_lang('Comparative reportDetail').'</p>',
'survey_reporting_comparative.png',
get_lang('Comparative report'),
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('Comparative report').'</h4><p>'.get_lang('Comparative reportDetail').'</p>',
$url.'action=comparativereport&survey_id='.$surveyId, $url.'action=comparativereport&survey_id='.$surveyId,
['class' => 'list-group-item'] ['class' => 'list-group-item']
); );
$html .= Display::url( $html .= Display::url(
Display::return_icon( Display::getMdiIcon('chart-multiple', 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Complete report')).'<h4>'.get_lang('Complete report').'</h4><p>'.get_lang('Complete reportDetail').'</p>',
'survey_reporting_complete.png',
get_lang('Complete report'),
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('Complete report').'</h4><p>'.get_lang('Complete reportDetail').'</p>',
$url.'action=completereport&survey_id='.$surveyId, $url.'action=completereport&survey_id='.$surveyId,
['class' => 'list-group-item'] ['class' => 'list-group-item']
); );

@ -832,16 +832,16 @@ class SurveyManager
// the images array // the images array
$icon_question = [ $icon_question = [
'yesno' => 'yesno.png', 'yesno' => 'thumbs-up-down',
'personality' => 'yesno.png', 'personality' => 'thumbs-up-down',
'multiplechoice' => 'mcua.png', 'multiplechoice' => 'format-list-bulleted',
'multipleresponse' => 'mcma.png', 'multipleresponse' => 'format-list-bulleted-square',
'open' => 'open_answer.png', 'open' => 'form-textarea',
'dropdown' => 'dropdown.png', 'dropdown' => 'form-dropdown',
'percentage' => 'percentagequestion.png', 'percentage' => 'percent-box-outline',
'score' => 'scorequestion.png', 'score' => 'format-annotation-plus',
'comment' => 'commentquestion.png', 'comment' => 'format-align-top',
'pagebreak' => 'page_end.png', 'pagebreak' => 'format-page-break',
]; ];
if (in_array($type, $possible_types)) { if (in_array($type, $possible_types)) {

@ -3,6 +3,9 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use ChamiloSession as Session; use ChamiloSession as Session;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Component\Utils\ToolIcon;
use Chamilo\CoreBundle\Component\Utils\StateIcon;
/** /**
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University:
@ -146,24 +149,24 @@ $survey_actions = '';
if (3 != $survey_data['survey_type']) { if (3 != $survey_data['survey_type']) {
$survey_actions = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq( $survey_actions = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq(
).'&action=edit&survey_id='.$survey_id.'">'. ).'&action=edit&survey_id='.$survey_id.'">'.
Display::return_icon('edit.png', get_lang('Edit survey'), '', ICON_SIZE_MEDIUM).'</a>'; Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Edit survey')).'</a>';
} }
$survey_actions .= '<a $survey_actions .= '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&action=delete&survey_id='.$survey_id.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('Delete survey').'?', ENT_QUOTES)).'\')) return false;">'. href="'.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq().'&action=delete&survey_id='.$survey_id.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('Delete survey').'?', ENT_QUOTES)).'\')) return false;">'.
Display::return_icon('delete.png', get_lang('Delete survey'), '', ICON_SIZE_MEDIUM).'</a>'; Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Delete survey')).'</a>';
if (3 != $survey_data['survey_type']) { if (3 != $survey_data['survey_type']) {
$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/preview.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'. $survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/preview.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.
Display::return_icon('preview_view.png', get_lang('Preview'), '', ICON_SIZE_MEDIUM).'</a>'; Display::getMdiIcon(ActionIcon::PREVIEW_CONTENT, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Preview')).'</a>';
} }
$survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'. $survey_actions .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invite.php?'.api_get_cidreq().'&survey_id='.$survey_id.'">'.
Display::return_icon('mail_send.png', get_lang('Publish'), '', ICON_SIZE_MEDIUM).'</a>'; Display::getMdiIcon(StateIcon::MAIL_NOTIFICATION, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Publish')).'</a>';
if (3 != $survey_data['survey_type']) { if (3 != $survey_data['survey_type']) {
if ('true' !== api_get_setting('survey.hide_survey_reporting_button')) { if ('true' !== api_get_setting('survey.hide_survey_reporting_button')) {
$survey_actions .= Display::url( $survey_actions .= Display::url(
Display::return_icon('statistics.png', get_lang('Reporting'), [], ICON_SIZE_MEDIUM), Display::getMdiIcon(ToolIcon::TRACKING, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Reporting')),
api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&survey_id='.$survey_id api_get_path(WEB_CODE_PATH).'survey/reporting.php?'.api_get_cidreq().'&survey_id='.$survey_id
); );
} }
@ -175,48 +178,48 @@ echo Display::toolbarAction('survey', [$survey_actions]);
$urlQuestion = api_get_path(WEB_CODE_PATH).'survey/question.php?'.api_get_cidreq().'&action=add'; $urlQuestion = api_get_path(WEB_CODE_PATH).'survey/question.php?'.api_get_cidreq().'&action=add';
if (0 == $survey_data['survey_type']) { if (0 == $survey_data['survey_type']) {
$questions = Display::url( $questions = Display::url(
Display::return_icon('yesno.png', get_lang('Yes / No'), null, ICON_SIZE_BIG), Display::getMdiIcon('thumbs-up-down', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Yes / No')),
$urlQuestion.'&type=yesno&survey_id='.$survey_id $urlQuestion.'&type=yesno&survey_id='.$survey_id
); );
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('mcua.png', get_lang('Multiple choice'), null, ICON_SIZE_BIG), Display::getMdiIcon('format-list-bulleted', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Multiple choice')),
$urlQuestion.'&type=multiplechoice&survey_id='.$survey_id $urlQuestion.'&type=multiplechoice&survey_id='.$survey_id
); );
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('mcma.png', get_lang('Multiple answers'), null, ICON_SIZE_BIG), Display::getMdiIcon('format-list-bulleted-square', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Multiple answers')),
$urlQuestion.'&type=multipleresponse&survey_id='.$survey_id $urlQuestion.'&type=multipleresponse&survey_id='.$survey_id
); );
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('open_answer.png', get_lang('Open'), null, ICON_SIZE_BIG), Display::getMdiIcon('form-textarea', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Open')),
$urlQuestion.'&type=open&survey_id='.$survey_id $urlQuestion.'&type=open&survey_id='.$survey_id
); );
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('dropdown.png', get_lang('Dropdown'), null, ICON_SIZE_BIG), Display::getMdiIcon('form-dropdown', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Dropdown')),
$urlQuestion.'&type=dropdown&survey_id='.$survey_id $urlQuestion.'&type=dropdown&survey_id='.$survey_id
); );
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('percentagequestion.png', get_lang('Percentage'), null, ICON_SIZE_BIG), Display::getMdiIcon('percent-box-outline', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Percentage')),
$urlQuestion.'&type=percentage&survey_id='.$survey_id $urlQuestion.'&type=percentage&survey_id='.$survey_id
); );
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('scorequestion.png', get_lang('Score'), null, ICON_SIZE_BIG), Display::getMdiIcon('format-annotation-plus', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Score')),
$urlQuestion.'&type=score&survey_id='.$survey_id $urlQuestion.'&type=score&survey_id='.$survey_id
); );
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('commentquestion.png', get_lang('Comment'), null, ICON_SIZE_BIG), Display::getMdiIcon('format-align-top', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Comment')),
$urlQuestion.'&type=comment&survey_id='.$survey_id $urlQuestion.'&type=comment&survey_id='.$survey_id
); );
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('mcua.png', get_lang('SurveyMultipleAnswerWithOther'), null, ICON_SIZE_BIG), Display::getMdiIcon('format-list-bulleted-type', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('SurveyMultipleAnswerWithOther')),
$urlQuestion.'&type=multiplechoiceother&survey_id='.$survey_id $urlQuestion.'&type=multiplechoiceother&survey_id='.$survey_id
); );
if (0 == $survey_data['one_question_per_page']) { if (0 == $survey_data['one_question_per_page']) {
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('yesno.png', get_lang('SurveyQuestionSelectiveDisplay'), null, ICON_SIZE_BIG), Display::getMdiIcon('thumbs-up-down', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('SurveyQuestionSelectiveDisplay')),
$urlQuestion.'&type=selectivedisplay&survey_id='.$survey_id $urlQuestion.'&type=selectivedisplay&survey_id='.$survey_id
); );
$questions .= Display::url( $questions .= Display::url(
Display::return_icon('page_end.png', get_lang('Pagebreak'), null, ICON_SIZE_BIG), Display::getMdiIcon('format-page-break', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Pagebreak')),
$urlQuestion.'&type=pagebreak&survey_id='.$survey_id $urlQuestion.'&type=pagebreak&survey_id='.$survey_id
); );
} }
@ -226,7 +229,7 @@ if (0 == $survey_data['survey_type']) {
if (3 != $survey_data['survey_type']) { if (3 != $survey_data['survey_type']) {
echo '<div class="well">'; echo '<div class="well">';
echo Display::url( echo Display::url(
Display::return_icon('yesno.png', get_lang('Yes / No'), null, ICON_SIZE_BIG), Display::getMdiIcon('thumbs-up-down', 'ch-tool-icon', null, ICON_SIZE_BIG, get_lang('Yes / No')),
$urlQuestion.'&type=personality&survey_id='.$survey_id $urlQuestion.'&type=personality&survey_id='.$survey_id
); );
echo '</a></div>'; echo '</a></div>';
@ -321,35 +324,35 @@ while ($row = Database::fetch_array($result, 'ASSOC')) {
echo '<a echo '<a
href="'.api_get_path(WEB_CODE_PATH). href="'.api_get_path(WEB_CODE_PATH).
'survey/question.php?'.api_get_cidreq().'&action=edit&type='.$row['type'].'&survey_id='.$survey_id.'&question_id='.$questionId.'">'. 'survey/question.php?'.api_get_cidreq().'&action=edit&type='.$row['type'].'&survey_id='.$survey_id.'&question_id='.$questionId.'">'.
Display::return_icon('edit.png', get_lang('Edit')).'</a>'; Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a>';
} }
echo '<a echo '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'. href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.
api_get_cidreq().'&action=copyquestion&type='.$row['type'].'&survey_id='.$survey_id.'&question_id='.$questionId.'">'. api_get_cidreq().'&action=copyquestion&type='.$row['type'].'&survey_id='.$survey_id.'&question_id='.$questionId.'">'.
Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).'</a>'; Display::getMdiIcon(ActionIcon::COPY_CONTENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Copy')).'</a>';
echo '<a echo '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'. href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.
api_get_cidreq().'&action=delete&survey_id='.$survey_id.'&question_id='.$questionId.'" api_get_cidreq().'&action=delete&survey_id='.$survey_id.'&question_id='.$questionId.'"
onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurveyQuestion").'?', ENT_QUOTES)).'\')) return false;">'. onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurveyQuestion").'?', ENT_QUOTES)).'\')) return false;">'.
Display::return_icon('delete.png', get_lang('Delete')).'</a>'; Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Delete')).'</a>';
if (3 != $survey_data['survey_type']) { if (3 != $survey_data['survey_type']) {
if ($question_counter > 1) { if ($question_counter > 1) {
echo '<a echo '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'. href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.
api_get_cidreq().'&action=moveup&survey_id='.$survey_id.'&question_id='.$questionId.'">'. api_get_cidreq().'&action=moveup&survey_id='.$survey_id.'&question_id='.$questionId.'">'.
Display::return_icon('up.png', get_lang('Move up')).'</a>'; Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move up')).'</a>';
} else { } else {
echo Display::return_icon('up_na.png', '&nbsp;', '', ICON_SIZE_SMALL); echo Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, '&nbsp;');
} }
if ($question_counter < $question_counter_max) { if ($question_counter < $question_counter_max) {
echo '<a echo '<a
href="'.api_get_path(WEB_CODE_PATH). href="'.api_get_path(WEB_CODE_PATH).
'survey/survey.php?'.api_get_cidreq().'&action=movedown&survey_id='.$survey_id.'&question_id='.$questionId.'">'. 'survey/survey.php?'.api_get_cidreq().'&action=movedown&survey_id='.$survey_id.'&question_id='.$questionId.'">'.
Display::return_icon('down.png', get_lang('Move down')).'</a>'; Display::getMdiIcon(ActionIcon::DOWN, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Move down')).'</a>';
} else { } else {
echo Display::return_icon('down_na.png', '&nbsp;', '', ICON_SIZE_SMALL); echo Display::getMdiIcon(ActionIcon::DOWN, 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL,'&nbsp;');
} }
} }
echo ' </td>'; echo ' </td>';
@ -428,11 +431,11 @@ if ($is_survey_type_1) {
while ($row = Database::fetch_array($rs, 'ASSOC')) { while ($row = Database::fetch_array($rs, 'ASSOC')) {
$grouplist .= '<tr><td>'.$row['name'].'</td><td>'.$row['description'].'</td><td>'. $grouplist .= '<tr><td>'.$row['name'].'</td><td>'.$row['description'].'</td><td>'.
'<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=editgroup">'. '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=editgroup">'.
Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a> '. Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).'</a> '.
'<a '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=deletegroup" href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'&gid='.$row['id'].'&action=deletegroup"
onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('Delete surveyGroup'), $row['name']).'?', ENT_QUOTES)).'\')) return false;">'. onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('Delete surveyGroup'), $row['name']).'?', ENT_QUOTES)).'\')) return false;">'.
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'. Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).'</a>'.
'</td></tr>'; '</td></tr>';
} }
echo $grouplist.'</table>'; echo $grouplist.'</table>';

@ -14,6 +14,10 @@ use Chamilo\CourseBundle\Entity\CSurveyInvitation;
use Chamilo\CourseBundle\Entity\CSurveyQuestion; use Chamilo\CourseBundle\Entity\CSurveyQuestion;
use Chamilo\CourseBundle\Entity\CSurveyQuestionOption; use Chamilo\CourseBundle\Entity\CSurveyQuestionOption;
use ChamiloSession as Session; use ChamiloSession as Session;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Component\Utils\ToolIcon;
use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
use Chamilo\CoreBundle\Component\Utils\StateIcon;
/** /**
* This class offers a series of general utility functions for survey querying and display. * This class offers a series of general utility functions for survey querying and display.
@ -442,26 +446,21 @@ class SurveyUtil
// Actions bar // Actions bar
if ($addActionBar) { if ($addActionBar) {
$actions = '<a href="'.$reportingUrl.'">'. $actions = '<a href="'.$reportingUrl.'">'.
Display::return_icon( Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Reporting overview'))
'back.png',
get_lang('Back to').' '.get_lang('Reporting overview'),
'',
ICON_SIZE_MEDIUM
)
.'</a>'; .'</a>';
if (isset($_GET['user'])) { if (isset($_GET['user'])) {
if (api_is_allowed_to_edit()) { if (api_is_allowed_to_edit()) {
// The delete link // The delete link
$actions .= '<a $actions .= '<a
href="'.$reportingUrl.'&action=deleteuserreport&user='.Security::remove_XSS($_GET['user']).'" >'. href="'.$reportingUrl.'&action=deleteuserreport&user='.Security::remove_XSS($_GET['user']).'" >'.
Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_MEDIUM).'</a>'; Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Delete')).'</a>';
} }
// Export the user report // Export the user report
$actions .= '<a href="javascript: void(0);" onclick="document.form1a.submit();">' $actions .= '<a href="javascript: void(0);" onclick="document.form1a.submit();">'
.Display::return_icon('export_csv.png', get_lang('CSV export'), '', ICON_SIZE_MEDIUM).'</a> '; .Display::getMdiIcon(ActionIcon::EXPORT_CSV, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('CSV export')).'</a> ';
$actions .= '<a href="javascript: void(0);" onclick="document.form1b.submit();">' $actions .= '<a href="javascript: void(0);" onclick="document.form1b.submit();">'
.Display::return_icon('export_excel.png', get_lang('Excel export'), '', ICON_SIZE_MEDIUM).'</a> '; .Display::getMdiIcon(ActionIcon::EXPORT_SPREADSHEET, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Excel export')).'</a> ';
$actions .= '<form id="form1a" name="form1a" method="post" action="'.api_get_self().'?action=' $actions .= '<form id="form1a" name="form1a" method="post" action="'.api_get_self().'?action='
.Security::remove_XSS($_GET['action']).'&survey_id='.$surveyId.'&'.api_get_cidreq().'&user_id=' .Security::remove_XSS($_GET['action']).'&survey_id='.$surveyId.'&'.api_get_cidreq().'&user_id='
.Security::remove_XSS($_GET['user']).'">'; .Security::remove_XSS($_GET['user']).'">';
@ -520,19 +519,12 @@ class SurveyUtil
$actions = '<a $actions = '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq().'">'. href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq().'">'.
Display::return_icon( Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Reporting overview'),
'back.png',
get_lang('Back to').' '.get_lang('Reporting overview'),
'', '',
ICON_SIZE_MEDIUM ICON_SIZE_MEDIUM
).'</a>'; ).'</a>';
$actions .= Display::url( $actions .= Display::url(
Display::return_icon( Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ExportToPdf')),
'pdf.png',
get_lang('ExportToPdf'),
'',
ICON_SIZE_MEDIUM
),
'javascript: void(0);', 'javascript: void(0);',
['onclick' => 'exportToPdf();'] ['onclick' => 'exportToPdf();']
); );
@ -963,19 +955,17 @@ class SurveyUtil
if ($addActionBar) { if ($addActionBar) {
$actions = '<a $actions = '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq().'">' href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq().'">'
.Display::return_icon( .Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Reporting overview'),
'back.png',
get_lang('Back to').' '.get_lang('Reporting overview'),
[], [],
ICON_SIZE_MEDIUM ICON_SIZE_MEDIUM
) )
.'</a>'; .'</a>';
$actions .= '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1a.submit();">' $actions .= '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1a.submit();">'
.Display::return_icon('export_csv.png', get_lang('CSV export'), '', ICON_SIZE_MEDIUM).'</a>'; .Display::getMdiIcon(ActionIcon::EXPORT_CSV, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('CSV export')).'</a>';
$actions .= '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1b.submit();">' $actions .= '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1b.submit();">'
.Display::return_icon('export_excel.png', get_lang('Excel export'), '', ICON_SIZE_MEDIUM).'</a>'; .Display::getMdiIcon(ActionIcon::EXPORT_SPREADSHEET, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Excel export')).'</a>';
$actions .= '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1c.submit();">' $actions .= '<a class="survey_export_link" href="javascript: void(0);" onclick="document.form1c.submit();">'
.Display::return_icon('export_compact_csv.png', get_lang('ExportAsCompactCSV'), '', ICON_SIZE_MEDIUM).'</a>'; .Display::getMdiIcon(ActionIcon::EXPORT_ARCHIVE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ExportAsCompactCSV')).'</a>';
$content .= Display::toolbarAction('survey', [$actions]); $content .= Display::toolbarAction('survey', [$actions]);
@ -1998,12 +1988,7 @@ class SurveyUtil
WEB_CODE_PATH WEB_CODE_PATH
).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq() ).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq()
.'">' .'">'
.Display::return_icon( .Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Reporting overview'))
'back.png',
get_lang('Back to').' '.get_lang('Reporting overview'),
[],
ICON_SIZE_MEDIUM
)
.'</a>'; .'</a>';
echo Display::toolbarAction('survey', [$actions]); echo Display::toolbarAction('survey', [$actions]);
@ -2991,7 +2976,7 @@ class SurveyUtil
parse_str(api_get_cidreq(), $params); parse_str(api_get_cidreq(), $params);
$reportingLink = Display::url( $reportingLink = Display::url(
Display::return_icon('statistics.png', get_lang('Reporting')), Display::getMdiIcon(ToolIcon::TRACKING, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Reporting')),
$codePath.'survey/reporting.php?'.http_build_query($params + ['survey_id' => $survey_id]) $codePath.'survey/reporting.php?'.http_build_query($params + ['survey_id' => $survey_id])
); );
@ -3013,48 +2998,48 @@ class SurveyUtil
} }
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('edit.png', get_lang('Edit')), Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')),
$editUrl $editUrl
); );
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('settings.png', get_lang('Configure')), Display::getMdiIcon(ToolIcon::SETTINGS, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Configure')),
$configUrl $configUrl
); );
if (SurveyManager::survey_generation_hash_available()) { if (SurveyManager::survey_generation_hash_available()) {
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('new_link.png', get_lang('Generate survey access link')), Display::getMdiIcon(ToolIcon::LINK, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Generate survey access link')),
$codePath.'survey/generate_link.php?'.http_build_query($params + ['survey_id' => $survey_id]) $codePath.'survey/generate_link.php?'.http_build_query($params + ['survey_id' => $survey_id])
); );
} }
if (3 != $type) { if (3 != $type) {
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('backup.png', get_lang('Copy survey')), Display::getMdiIcon(ActionIcon::COPY_CONTENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Copy survey')),
$codePath.'survey/copy_survey.php?'.http_build_query($params + ['survey_id' => $survey_id]) $codePath.'survey/copy_survey.php?'.http_build_query($params + ['survey_id' => $survey_id])
); );
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('copy.png', get_lang('Duplicate survey')), Display::getMdiIcon(ObjectIcon::MULTI_ELEMENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Duplicate survey')),
$codePath.'survey/survey_list.php?' $codePath.'survey/survey_list.php?'
.http_build_query($params + ['action' => 'copy_survey', 'survey_id' => $survey_id]) .http_build_query($params + ['action' => 'copy_survey', 'survey_id' => $survey_id])
); );
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('multiplicate_survey.png', get_lang('Multiplicate questions')), Display::getMdiIcon('view-grid-plus-outline', 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Multiplicate questions')),
$codePath.'survey/survey_list.php?' $codePath.'survey/survey_list.php?'
.http_build_query($params + ['action' => 'multiplicate', 'survey_id' => $survey_id]) .http_build_query($params + ['action' => 'multiplicate', 'survey_id' => $survey_id])
); );
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('multiplicate_survey_na.png', get_lang('RemoveMultiplicate questions')), Display::getMdiIcon('view-grid-plus-outline', 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('RemoveMultiplicate questions')),
$codePath.'survey/survey_list.php?' $codePath.'survey/survey_list.php?'
.http_build_query($params + ['action' => 'remove_multiplicate', 'survey_id' => $survey_id]) .http_build_query($params + ['action' => 'remove_multiplicate', 'survey_id' => $survey_id])
); );
$warning = addslashes(api_htmlentities(get_lang('Empty survey').'?', ENT_QUOTES)); $warning = addslashes(api_htmlentities(get_lang('Empty survey').'?', ENT_QUOTES));
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('clean.png', get_lang('Empty survey')), Display::getMdiIcon(ActionIcon::RESET, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Empty survey')),
$codePath.'survey/survey_list.php?' $codePath.'survey/survey_list.php?'
.http_build_query($params + ['action' => 'empty', 'survey_id' => $survey_id]), .http_build_query($params + ['action' => 'empty', 'survey_id' => $survey_id]),
[ [
@ -3066,13 +3051,13 @@ class SurveyUtil
if (3 != $type) { if (3 != $type) {
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('preview_view.png', get_lang('Preview')), Display::getMdiIcon(ActionIcon::PREVIEW_CONTENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Preview')),
$codePath.'survey/preview.php?'.http_build_query($params + ['survey_id' => $survey_id]) $codePath.'survey/preview.php?'.http_build_query($params + ['survey_id' => $survey_id])
); );
} }
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('mail_send.png', get_lang('Publish')), Display::getMdiIcon(StateIcon::MAIL_NOTIFICATION, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Publish')),
$codePath.'survey/survey_invite.php?'.http_build_query($params + ['survey_id' => $survey_id]) $codePath.'survey/survey_invite.php?'.http_build_query($params + ['survey_id' => $survey_id])
); );
@ -3080,7 +3065,7 @@ class SurveyUtil
$groupData = $extraFieldValue->get_values_by_handler_and_field_variable($survey_id, 'group_id'); $groupData = $extraFieldValue->get_values_by_handler_and_field_variable($survey_id, 'group_id');
if ($groupData && !empty($groupData['value'])) { if ($groupData && !empty($groupData['value'])) {
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('teacher.png', get_lang('SendToGroupTutors')), Display::getMdiIcon(ObjectIcon::TEACHER, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('SendToGroupTutors')),
$codePath.'survey/survey_list.php?action=send_to_tutors&'.http_build_query($params + ['survey_id' => $survey_id]) $codePath.'survey/survey_list.php?action=send_to_tutors&'.http_build_query($params + ['survey_id' => $survey_id])
); );
} }
@ -3096,7 +3081,7 @@ class SurveyUtil
$warning = addslashes(api_htmlentities(get_lang('Delete survey').'?', ENT_QUOTES)); $warning = addslashes(api_htmlentities(get_lang('Delete survey').'?', ENT_QUOTES));
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('delete.png', get_lang('Delete')), Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')),
$codePath.'survey/survey_list.php?' $codePath.'survey/survey_list.php?'
.http_build_query($params + ['action' => 'delete', 'survey_id' => $survey_id]), .http_build_query($params + ['action' => 'delete', 'survey_id' => $survey_id]),
[ [
@ -3153,16 +3138,16 @@ class SurveyUtil
$params = []; $params = [];
parse_str(api_get_cidreq(), $params); parse_str(api_get_cidreq(), $params);
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('preview_view.png', get_lang('Preview')), Display::getMdiIcon(ActionIcon::PREVIEW_CONTENT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Preview')),
$codePath.'survey/preview.php?'.http_build_query($params + ['survey_id' => $survey_id]) $codePath.'survey/preview.php?'.http_build_query($params + ['survey_id' => $survey_id])
); );
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('mail_send.png', get_lang('Publish')), Display::getMdiIcon(StateIcon::MAIL_NOTIFICATION, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Publish')),
$codePath.'survey/survey_invite.php?'.http_build_query($params + ['survey_id' => $survey_id]) $codePath.'survey/survey_invite.php?'.http_build_query($params + ['survey_id' => $survey_id])
); );
$warning = addslashes(api_htmlentities(get_lang('Empty survey').'?', ENT_QUOTES)); $warning = addslashes(api_htmlentities(get_lang('Empty survey').'?', ENT_QUOTES));
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('clean.png', get_lang('Empty survey')), Display::getMdiIcon(ActionIcon::RESET, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Empty survey')),
$codePath.'survey/survey_list.php?' $codePath.'survey/survey_list.php?'
.http_build_query($params + ['action' => 'empty', 'survey_id' => $survey_id]), .http_build_query($params + ['action' => 'empty', 'survey_id' => $survey_id]),
[ [
@ -3599,12 +3584,7 @@ class SurveyUtil
if (0 == $survey->getAnswered()) { if (0 == $survey->getAnswered()) {
echo '<td>'; echo '<td>';
$url = self::generateFillSurveyLink($survey, $row['invitation_code'], $course, $row['session_id']); $url = self::generateFillSurveyLink($survey, $row['invitation_code'], $course, $row['session_id']);
$icon = Display::return_icon( $icon = Display::getMdiIcon(ToolIcon::SURVEY, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('ClickHereToAnswerTheSurvey'));
'survey.png',
get_lang('ClickHereToAnswerTheSurvey'),
['style' => 'margin-top: -4px'],
ICON_SIZE_TINY
);
echo '<a href="'.$url.'"> echo '<a href="'.$url.'">
'.$icon '.$icon
.$row['title'] .$row['title']
@ -3614,12 +3594,7 @@ class SurveyUtil
$user_id, $user_id,
$_course $_course
); );
$icon = Display::return_icon( $icon = Display::getMdiIcon(ObjectIcon::SURVEY, 'ch-tool-icon-disabled', null, ICON_SIZE_TINY, get_lang('SurveysDone'));
'survey_na.png',
get_lang('SurveysDone'),
[],
ICON_SIZE_TINY
);
$showLink = (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse) $showLink = (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse)
&& SURVEY_VISIBLE_TUTOR != $row['visible_results']; && SURVEY_VISIBLE_TUTOR != $row['visible_results'];

@ -5,6 +5,8 @@
use Chamilo\CoreBundle\Framework\Container; use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CSurvey; use Chamilo\CourseBundle\Entity\CSurvey;
use ChamiloSession as Session; use ChamiloSession as Session;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Component\Utils\ObjectIcon;
/** /**
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University: cleanup, refactoring and rewriting large parts of
@ -574,15 +576,15 @@ $actions = '';
if (!api_is_session_general_coach() || 'true' === $extend_rights_for_coachs) { if (!api_is_session_general_coach() || 'true' === $extend_rights_for_coachs) {
$actions .= '<a $actions .= '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&amp;action=add">'. href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&amp;action=add">'.
Display::return_icon('new_survey.png', get_lang('Create survey'), '', ICON_SIZE_MEDIUM).'</a> '; Display::getMdiIcon(ObjectIcon::SURVEY, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Create survey')).'</a> ';
$url = api_get_path(WEB_CODE_PATH).'survey/create_meeting.php?'.api_get_cidreq(); $url = api_get_path(WEB_CODE_PATH).'survey/create_meeting.php?'.api_get_cidreq();
$actions .= Display::url( $actions .= Display::url(
Display::return_icon('add_doodle.png', get_lang('Create surveyDoodle'), '', ICON_SIZE_MEDIUM), Display::getMdiIcon(ObjectIcon::SURVEY_DOODLE, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Create surveyDoodle')),
$url $url
); );
} }
$actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;search=advanced">'. $actions .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;search=advanced">'.
Display::return_icon('search.png', get_lang('Search'), '', ICON_SIZE_MEDIUM).'</a>'; Display::getMdiIcon(ActionIcon::SEARCH, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Search')).'</a>';
echo Display::toolbarAction('toolbar', [$actions]); echo Display::toolbarAction('toolbar', [$actions]);

@ -203,10 +203,12 @@ class survey_question
$allowParent = false; $allowParent = false;
} }
$icon = Display::return_icon( $icon = Display::getMdiIcon(
SurveyManager::icon_question($type), SurveyManager::icon_question($type),
$toolName, 'ch-tool-icon',
['align' => 'middle', 'height' => '22px'] ['align' => 'middle'],
ICON_SIZE_SMALL,
$toolName
).' '; ).' ';
$toolName = $icon.$actionHeader.$toolName; $toolName = $icon.$actionHeader.$toolName;

Loading…
Cancel
Save