Minor - hide unused options for "meeting" survey type

pull/2729/head
Julio Montoya 7 years ago
parent 2f2ecfbc08
commit df7c04b54e
  1. 45
      main/survey/surveyUtil.class.php

@ -2878,6 +2878,8 @@ class SurveyUtil
return $hideReportingButton ? '-' : $reportingLink; return $hideReportingButton ? '-' : $reportingLink;
} }
$type = $survey->getSurveyType();
// Coach can see that only if the survey is in his session // Coach can see that only if the survey is in his session
if (api_is_allowed_to_edit() || if (api_is_allowed_to_edit() ||
api_is_element_in_the_session(TOOL_SURVEY, $survey_id) api_is_element_in_the_session(TOOL_SURVEY, $survey_id)
@ -2893,30 +2895,35 @@ class SurveyUtil
$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])
); );
} }
$actions[] = Display::url(
Display::return_icon('backup.png', get_lang('CopySurvey')), if ($type != 3) {
$codePath.'survey/copy_survey.php?'.http_build_query($params + ['survey_id' => $survey_id]) $actions[] = Display::url(
); Display::return_icon('backup.png', get_lang('CopySurvey')),
$actions[] = Display::url( $codePath.'survey/copy_survey.php?'.http_build_query($params + ['survey_id' => $survey_id])
Display::return_icon('copy.png', get_lang('DuplicateSurvey')), );
$codePath.'survey/survey_list.php?' $actions[] = Display::url(
Display::return_icon('copy.png', get_lang('DuplicateSurvey')),
$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])
); );
$warning = addslashes(api_htmlentities(get_lang('EmptySurvey').'?', ENT_QUOTES)); $warning = addslashes(api_htmlentities(get_lang('EmptySurvey').'?', ENT_QUOTES));
$actions[] = Display::url( $actions[] = Display::url(
Display::return_icon('clean.png', get_lang('EmptySurvey')), Display::return_icon('clean.png', get_lang('EmptySurvey')),
$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]),
[ [
'onclick' => "javascript: if (!confirm('".$warning."')) return false;", 'onclick' => "javascript: if (!confirm('".$warning."')) return false;",
] ]
);
}
}
if ($type != 3) {
$actions[] = Display::url(
Display::return_icon('preview_view.png', get_lang('Preview')),
$codePath.'survey/preview.php?'.http_build_query($params + ['survey_id' => $survey_id])
); );
} }
$actions[] = Display::url(
Display::return_icon('preview_view.png', get_lang('Preview')),
$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::return_icon('mail_send.png', 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])

Loading…
Cancel
Save