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\CourseBundle\Entity\CSurvey;
use Chamilo\CoreBundle\Component\Utils\ActionIcon;
use Chamilo\CoreBundle\Component\Utils\StateIcon;
require_once __DIR__.'/../inc/global.inc.php';
@ -176,8 +178,8 @@ foreach ($questions as $item) {
$row = 2;
$column = 0;
$availableIcon = Display::return_icon('bullet_green.png', get_lang('Available'));
$notAvailableIcon = Display::return_icon('bullet_red.png', get_lang('Not available'));
$availableIcon = Display::getMdiIcon(StateIcon::ACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Available'));
$notAvailableIcon = Display::getMdiIcon(StateIcon::INACTIVE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Not available'));
foreach ($students as $studentId) {
$userInfo = api_get_user_info($studentId);
@ -185,7 +187,7 @@ foreach ($students as $studentId) {
if ($userId == $studentId) {
if ('edit' !== $action) {
$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
);
}
@ -263,16 +265,16 @@ if ('edit' === $action) {
$actions = '';
if (api_is_allowed_to_edit()) {
$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
);
$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,
['onclick' => 'javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('Delete survey').'?', ENT_QUOTES)).'\')) return false;']
);
$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
);
}

@ -3,6 +3,7 @@
/* For licensing terms, see /license.txt */
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
@ -83,7 +84,7 @@ $possible_types = [
$actions = '<div class="actions">';
$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>';
// Checking if it is a valid type
if (!in_array($_GET['type'], $possible_types)) {

@ -229,56 +229,31 @@ if ('overview' === $action) {
$html .= '<div class="survey-reports">';
$html .= '<div class="list-group">';
$html .= Display::url(
Display::return_icon(
'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>',
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>',
$url.'action=questionreport&survey_id='.$surveyId.'&single_page=1',
['class' => 'list-group-item']
);
$html .= Display::url(
Display::return_icon(
'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>',
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>',
$url.'action=questionreport&survey_id='.$surveyId,
['class' => 'list-group-item']
);
$html .= Display::url(
Display::return_icon(
'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>',
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>',
$url.'action=userreport&survey_id='.$surveyId,
['class' => 'list-group-item']
);
$html .= Display::url(
Display::return_icon(
'survey_reporting_comparative.png',
get_lang('Comparative report'),
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('Comparative report').'</h4><p>'.get_lang('Comparative reportDetail').'</p>',
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>',
$url.'action=comparativereport&survey_id='.$surveyId,
['class' => 'list-group-item']
);
$html .= Display::url(
Display::return_icon(
'survey_reporting_complete.png',
get_lang('Complete report'),
null,
ICON_SIZE_MEDIUM
).'<h4>'.get_lang('Complete report').'</h4><p>'.get_lang('Complete reportDetail').'</p>',
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>',
$url.'action=completereport&survey_id='.$surveyId,
['class' => 'list-group-item']
);

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

@ -3,6 +3,9 @@
/* For licensing terms, see /license.txt */
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:
@ -146,24 +149,24 @@ $survey_actions = '';
if (3 != $survey_data['survey_type']) {
$survey_actions = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq(
).'&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
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']) {
$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.'">'.
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 ('true' !== api_get_setting('survey.hide_survey_reporting_button')) {
$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
);
}
@ -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';
if (0 == $survey_data['survey_type']) {
$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
);
$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
);
$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
);
$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
);
$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
);
$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
);
$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
);
$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
);
$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
);
if (0 == $survey_data['one_question_per_page']) {
$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
);
$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
);
}
@ -226,7 +229,7 @@ if (0 == $survey_data['survey_type']) {
if (3 != $survey_data['survey_type']) {
echo '<div class="well">';
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
);
echo '</a></div>';
@ -321,35 +324,35 @@ while ($row = Database::fetch_array($result, 'ASSOC')) {
echo '<a
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.'">'.
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
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.'">'.
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
href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.
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;">'.
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 ($question_counter > 1) {
echo '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.
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 {
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) {
echo '<a
href="'.api_get_path(WEB_CODE_PATH).
'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 {
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>';
@ -428,11 +431,11 @@ if ($is_survey_type_1) {
while ($row = Database::fetch_array($rs, 'ASSOC')) {
$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">'.
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
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;">'.
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>';
}
echo $grouplist.'</table>';

@ -14,6 +14,10 @@ use Chamilo\CourseBundle\Entity\CSurveyInvitation;
use Chamilo\CourseBundle\Entity\CSurveyQuestion;
use Chamilo\CourseBundle\Entity\CSurveyQuestionOption;
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.
@ -442,26 +446,21 @@ class SurveyUtil
// Actions bar
if ($addActionBar) {
$actions = '<a href="'.$reportingUrl.'">'.
Display::return_icon(
'back.png',
get_lang('Back to').' '.get_lang('Reporting overview'),
'',
ICON_SIZE_MEDIUM
)
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Reporting overview'))
.'</a>';
if (isset($_GET['user'])) {
if (api_is_allowed_to_edit()) {
// The delete link
$actions .= '<a
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
$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();">'
.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='
.Security::remove_XSS($_GET['action']).'&survey_id='.$surveyId.'&'.api_get_cidreq().'&user_id='
.Security::remove_XSS($_GET['user']).'">';
@ -520,19 +519,12 @@ class SurveyUtil
$actions = '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq().'">'.
Display::return_icon(
'back.png',
get_lang('Back to').' '.get_lang('Reporting overview'),
Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Reporting overview'),
'',
ICON_SIZE_MEDIUM
).'</a>';
$actions .= Display::url(
Display::return_icon(
'pdf.png',
get_lang('ExportToPdf'),
'',
ICON_SIZE_MEDIUM
),
Display::getMdiIcon(ActionIcon::EXPORT_PDF, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('ExportToPdf')),
'javascript: void(0);',
['onclick' => 'exportToPdf();']
);
@ -963,19 +955,17 @@ class SurveyUtil
if ($addActionBar) {
$actions = '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq().'">'
.Display::return_icon(
'back.png',
get_lang('Back to').' '.get_lang('Reporting overview'),
.Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Reporting overview'),
[],
ICON_SIZE_MEDIUM
)
.'</a>';
$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();">'
.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();">'
.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]);
@ -1998,12 +1988,7 @@ class SurveyUtil
WEB_CODE_PATH
).'survey/reporting.php?survey_id='.$surveyId.'&'.api_get_cidreq()
.'">'
.Display::return_icon(
'back.png',
get_lang('Back to').' '.get_lang('Reporting overview'),
[],
ICON_SIZE_MEDIUM
)
.Display::getMdiIcon(ActionIcon::BACK, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Back to').' '.get_lang('Reporting overview'))
.'</a>';
echo Display::toolbarAction('survey', [$actions]);
@ -2991,7 +2976,7 @@ class SurveyUtil
parse_str(api_get_cidreq(), $params);
$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])
);
@ -3013,48 +2998,48 @@ class SurveyUtil
}
$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
);
$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
);
if (SurveyManager::survey_generation_hash_available()) {
$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])
);
}
if (3 != $type) {
$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])
);
$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?'
.http_build_query($params + ['action' => 'copy_survey', 'survey_id' => $survey_id])
);
$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?'
.http_build_query($params + ['action' => 'multiplicate', 'survey_id' => $survey_id])
);
$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?'
.http_build_query($params + ['action' => 'remove_multiplicate', 'survey_id' => $survey_id])
);
$warning = addslashes(api_htmlentities(get_lang('Empty survey').'?', ENT_QUOTES));
$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?'
.http_build_query($params + ['action' => 'empty', 'survey_id' => $survey_id]),
[
@ -3066,13 +3051,13 @@ class SurveyUtil
if (3 != $type) {
$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])
);
}
$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])
);
@ -3080,7 +3065,7 @@ class SurveyUtil
$groupData = $extraFieldValue->get_values_by_handler_and_field_variable($survey_id, 'group_id');
if ($groupData && !empty($groupData['value'])) {
$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])
);
}
@ -3096,7 +3081,7 @@ class SurveyUtil
$warning = addslashes(api_htmlentities(get_lang('Delete survey').'?', ENT_QUOTES));
$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?'
.http_build_query($params + ['action' => 'delete', 'survey_id' => $survey_id]),
[
@ -3153,16 +3138,16 @@ class SurveyUtil
$params = [];
parse_str(api_get_cidreq(), $params);
$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])
);
$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])
);
$warning = addslashes(api_htmlentities(get_lang('Empty survey').'?', ENT_QUOTES));
$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?'
.http_build_query($params + ['action' => 'empty', 'survey_id' => $survey_id]),
[
@ -3599,12 +3584,7 @@ class SurveyUtil
if (0 == $survey->getAnswered()) {
echo '<td>';
$url = self::generateFillSurveyLink($survey, $row['invitation_code'], $course, $row['session_id']);
$icon = Display::return_icon(
'survey.png',
get_lang('ClickHereToAnswerTheSurvey'),
['style' => 'margin-top: -4px'],
ICON_SIZE_TINY
);
$icon = Display::getMdiIcon(ToolIcon::SURVEY, 'ch-tool-icon', null, ICON_SIZE_TINY, get_lang('ClickHereToAnswerTheSurvey'));
echo '<a href="'.$url.'">
'.$icon
.$row['title']
@ -3614,12 +3594,7 @@ class SurveyUtil
$user_id,
$_course
);
$icon = Display::return_icon(
'survey_na.png',
get_lang('SurveysDone'),
[],
ICON_SIZE_TINY
);
$icon = Display::getMdiIcon(ObjectIcon::SURVEY, 'ch-tool-icon-disabled', null, ICON_SIZE_TINY, get_lang('SurveysDone'));
$showLink = (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse)
&& SURVEY_VISIBLE_TUTOR != $row['visible_results'];

@ -5,6 +5,8 @@
use Chamilo\CoreBundle\Framework\Container;
use Chamilo\CourseBundle\Entity\CSurvey;
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
@ -574,15 +576,15 @@ $actions = '';
if (!api_is_session_general_coach() || 'true' === $extend_rights_for_coachs) {
$actions .= '<a
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();
$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
);
}
$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]);

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

Loading…
Cancel
Save