Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/2487/head
jmontoyaa 9 years ago
commit 484544bd43
  1. 8
      .htaccess
  2. 40
      app/Resources/public/css/base.css
  3. 5
      app/Resources/public/css/themes/chamilo/default.css
  4. 3
      composer.json
  5. 10
      documentation/installation_guide.html
  6. 2
      main/admin/index.php
  7. 8
      main/admin/user_linking_requests.php
  8. 4
      main/course_info/infocours.php
  9. 4
      main/inc/lib/userportal.lib.php
  10. 7
      main/lang/english/trad4all.inc.php
  11. 7
      main/lang/french/trad4all.inc.php
  12. 7
      main/lang/spanish/trad4all.inc.php
  13. 6
      main/social/require_user_linking.php
  14. 53
      main/survey/fillsurvey.php
  15. 11
      main/survey/preview.php
  16. 70
      main/survey/surveyUtil.class.php
  17. 4
      main/template/default/announcement/slider.tpl
  18. 4
      main/template/default/announcement/view.tpl
  19. 2
      main/template/default/layout/hot_courses.tpl
  20. 17
      src/Chamilo/CoreBundle/Composer/ScriptHandler.php

@ -61,3 +61,11 @@ RewriteRule ^([^/.]+)/?$ user.php?$1 [L]
# Deny access
RewriteRule ^(tests|.git) - [F,L,NC]
# Add caching of woff font files to avoid loading 2*15KB each time with Chamilo
# default OpenSans font
AddType application/font-woff .woff .woff2
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType application/font-woff "access plus 1 month"
</IfModule>

@ -204,10 +204,8 @@ header {
margin: 25px auto;
text-align: center;
}
#notice_block p, #notice-block p{
color: #666;
font-size: 12px;
line-height: 20px;
#notice_block h5{
font-weight: bold;
}
.carousel-indicators{
bottom: 0px !important;
@ -306,16 +304,11 @@ header {
text-align:center;
vertical-align:middle;
}
.radio input[type="radio"]{
margin-left: -25px;
}
input[type=checkbox], input[type=radio]{
margin: 6px 0 0;
margin: 3px 0 0;
}
.prerequisites input[type=radio]{
margin: 0 0 0 -25px;
vertical-align: middle;
height: 20px;
height: 12px;
}
#gradebook_list .centered .badge-group {
width: auto;
@ -1607,8 +1600,8 @@ div.admin_section h4 {
right: 0;
}
.view-options{
padding-top: 2px;
padding-right: 10px;
padding-top: 3px;
padding-right: 5px;
}
#course_settings h3 img {
margin-left: 25px;
@ -3491,10 +3484,6 @@ i.size-32.icon-new-work{
margin-top: 4px;
margin-bottom: 10px;
}
.survey-block #question{
background-color: #ececec;
text-align: center;
}
.survey_question .title{
font-weight: bold;
padding-bottom: 10px;
@ -3507,6 +3496,10 @@ i.size-32.icon-new-work{
color:#000;
padding:5px;/*border: 1px solid #264269;*/
}
.survey_subtitle{
margin-top: 20px;
margin-bottom: 20px;
}
.survey_question .radio-inline input[type="radio"],
.survey_question .checkbox-inline input[type="checkbox"]{
margin-top: 2px;
@ -3861,10 +3854,6 @@ i.size-32.icon-new-work{
color: #666;
}
/* Items menus sidebar */
.sidebar .nav li a{
padding: 2px;
font-size: 12px;
}
.sidebar .nav li a img{
vertical-align: middle;
margin-right: 5px;
@ -6173,15 +6162,6 @@ ul#toolnavbox-two li a.btn{
font-size: 12px;
width: 100px;
}
.form-horizontal .radio{
padding-left: 5px;
}
.checkbox input[type="checkbox"]{
margin-left: -24px;
}
input[type=checkbox]{
margin: 8px 0 0;
}
.lp-accordion .panel-heading .panel-title{
width: 100%;
display: inline-block;

@ -148,7 +148,4 @@ a:focus {
}
.bgfooter a{
color: #ffffff;
}
.page-header{
margin: 10px 0 10px;
}
}

@ -132,7 +132,8 @@
],
"post-update-cmd": [
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::dumpCssFiles"
]
],
"update-css": "Chamilo\\CoreBundle\\Composer\\ScriptHandler::updateCss"
},
"extra": {
"symfony-app-dir": "app",

@ -736,6 +736,12 @@ If you have issues with files taking a long time to download, make sure you reco
RewriteRule ^([^/.]+)/?$ user.php?$1 [L]
RewriteRule ^(tests|.git) - [F,L,NC]
&lt;/Directory&gt;
AddType application/font-woff .woff .woff2
&lt;IfModule mod_expires.c&gt;
ExpiresActive On
ExpiresByType application/font-woff "access plus 1 month"
&lt;/IfModule&gt;
</pre>
<h3>Nginx</h3>
Nginx doesn't support .htaccess rules, so you have no other option than to apply the following rules (note that your PHP backend configuration may vary).
@ -791,8 +797,8 @@ If you have issues with files taking a long time to download, make sure you reco
}
# Serve static files directly
location ~* \.(png|jpe?g|gif|ico|js|css|mp3|swf|flv|mp4|ogg)$ {
expires 1y;
location ~* \.(png|jpe?g|gif|ico|js|css|mp3|swf|flv|mp4|ogg|woff|woff2)$ {
expires 30d;
access_log off;
rewrite ^/courses/([^/]+)/course-pic85x85.png$ /app/courses/$1/course-pic85x85.png last;
rewrite ^/courses/([^/]+)/course-pic.png$ /app/courses/$1/course-pic.png last;

@ -109,7 +109,7 @@ if (api_is_platform_admin()) {
}
$items[] = array('url' => 'extra_fields.php?type=user', 'label' => get_lang('ManageUserFields'));
$items[] = array('url'=>'usergroups.php', 'label' => get_lang('Classes'));
$items[] = ['url' => 'user_vinculation_requests.php', 'label' => get_lang('UserVinculationRequests')];
$items[] = ['url' => 'user_linking_requests.php', 'label' => get_lang('UserLinkingRequests')];
} elseif (api_is_session_admin() && api_get_configuration_value('limit_session_admin_role')) {
$items = array(
array('url' => 'user_list.php', 'label' => get_lang('UserList')),

@ -32,7 +32,7 @@ if ($action === 'accept' && $hrm && $assinedId) {
$em->flush();
Display::addFlash(
Display::return_message(get_lang('UserVinculationRequestAccepted'), 'success')
Display::return_message(get_lang('UserLinkingRequestAccepted'), 'success')
);
}
@ -75,7 +75,7 @@ function getData(User $hrm)
return $result;
}
$form = new FormValidator('user_vinculation_requests', 'get');
$form = new FormValidator('user_linking_requests', 'get');
$form->addSelectAjax(
'hrm',
get_lang('DRH'),
@ -91,7 +91,7 @@ if ($hrm) {
if ($requests) {
$content .= Display::table(
[get_lang('UserVinculationTo'), get_lang('Actions')],
[get_lang('UserLinkingTo'), get_lang('Actions')],
$requests
);
} else {
@ -101,7 +101,7 @@ if ($hrm) {
$interbreadcrumb[] = ['url' => 'index.php', 'name' => get_lang('PlatformAdmin')];
$toolName = get_lang('UserVinculationRequests');
$toolName = get_lang('UserLinkingRequests');
$view = new Template($toolName);
$view->assign('header', $toolName);

@ -311,14 +311,14 @@ $form->addGroup($group, '', array(get_lang("NewUserEmailAlert")));
$group = array();
$group[] = $form->createElement('radio', 'email_alert_students_on_new_homework', get_lang('NewHomeworkEmailAlert'), get_lang('NewHomeworkEmailAlertEnable'), 1);
$group[] = $form->createElement('radio', 'email_alert_students_on_new_homework', null, get_lang('NewHomeworkEmailAlertToDrhEnable'), 2);
$group[] = $form->createElement('radio', 'email_alert_students_on_new_homework', null, get_lang('NewHomeworkEmailAlertToHrmEnable'), 2);
$group[] = $form->createElement('radio', 'email_alert_students_on_new_homework', null, get_lang('NewHomeworkEmailAlertDisable'), 0);
$form->addGroup($group, '', array(get_lang("NewHomeworkEmailAlert")));
$group = array();
$group[] = $form->createElement('radio', 'email_alert_manager_on_new_doc', get_lang('WorkEmailAlert'), get_lang('WorkEmailAlertActivate'), 1);
$group[] = $form->createElement('radio', 'email_alert_manager_on_new_doc', null, get_lang('WorkEmailAlertActivateOnlyForTeachers'), 3);
$group[] = $form->createElement('radio', 'email_alert_manager_on_new_doc', null, get_lang('WorkEmailAlertActivateOnlyForStudents'), 2);
$group[] = $form->createElement('radio', 'email_alert_manager_on_new_doc', get_lang('WorkEmailAlert'), get_lang('WorkEmailAlertActivate'), 1);
$group[] = $form->createElement('radio', 'email_alert_manager_on_new_doc', null, get_lang('WorkEmailAlertDeactivate'), 0);
$form->addGroup($group, '', array(get_lang("WorkEmailAlert")));

@ -977,12 +977,12 @@ class IndexManager
.get_lang('EditProfile').'</a></li>';
if (api_get_configuration_value('show_link_request_hrm_user') && api_is_drh()) {
$label = get_lang('RequireVinculationWithUser');
$label = get_lang('RequestLinkingToUser');
$icon = Display::return_icon('new_group.png', $label);
$profile_content .= '<li>'
.Display::url(
$icon.$label,
api_get_path(WEB_CODE_PATH).'social/require_user_vinculation.php'
api_get_path(WEB_CODE_PATH).'social/require_user_linking.php'
)
.'</li>';
}

@ -8021,4 +8021,11 @@ $IsMandatory = "Mandatory?";
$StudentXHasBeenAssignedNewWorkInCourseY = "%s got a new assignment in course %s";
$AsHRMYouReceiveThisMailToAlertThatXHasNewWorkInCourseY = "As his/her human resources manager, you are receiving this e-mail to let you know that %s just got a new assignment in course %s";
$DearXComma = "Dear %s,";
$UserLinkingRequests = "User linking requests";
$NewHomeworkEmailAlertToHrmEnable = "Send e-mail to students and their HRM on assignments creation";
$UserLinkingRequestAccepted = "User linking request accepted";
$UserLinkingTo = "Linked to student";
$RequestLinkingToUser = "Request linking to student";
$LinkingRequestsAdded = "Linking request added";
$HrmList = "Human Resource Managers list";
?>

@ -7963,4 +7963,11 @@ $IsMandatory = "Obligatoire?";
$StudentXHasBeenAssignedNewWorkInCourseY = "Une nouvelle tâche a été assignée à %s dans le cours %s";
$AsHRMYouReceiveThisMailToAlertThatXHasNewWorkInCourseY = "En tant que son responsable RH, vous recevez cet e-mail pour vous avertir qu'une nouvelle tâche vient d'être assignée à %s dans le cours %s.";
$DearXComma = "Cher/Chère %s,";
$UserLinkingRequests = "Demandes de liaisons à utilisateurs";
$NewHomeworkEmailAlertToHrmEnable = "Envoyer un e-mail aux apprenants et à leurs directeurs de ressources humaines lors de la création d'un travail";
$UserLinkingRequestAccepted = "Demande de liaison acceptée";
$UserLinkingTo = "Lié à l'apprenant";
$RequestLinkingToUser = "Solliciter lien à apprenant";
$LinkingRequestsAdded = "Demande de liaison enregistrée";
$HrmList = "Liste des directeurs de ressources humaines";
?>

@ -8052,4 +8052,11 @@ $IsMandatory = "Obligatorio/a?";
$StudentXHasBeenAssignedNewWorkInCourseY = "Nueva tarea asignada a %s en el curso %s";
$AsHRMYouReceiveThisMailToAlertThatXHasNewWorkInCourseY = "Como su responsable RH, está recibiendo este correo para avisarle que una nueva tarea acaba de ser asignada a %s en el curso %s.";
$DearXComma = "Estimado/a %s,";
$UserLinkingRequests = "Solicitudes de vinculación a estudiantes";
$NewHomeworkEmailAlertToHrmEnable = "Enviar un correo a los estudiantes y sus responsables de recursos humanos a la creación de una tarea";
$UserLinkingRequestAccepted = "Solicitud de vinculación a estudiante aceptada";
$UserLinkingTo = "Vinculado al estudiante";
$RequestLinkingToUser = "Solicitar vinculación a estudiante";
$LinkingRequestsAdded = "Solicitud de vinculación añadida";
$HrmList = "Lista de responsables de recursos humanos";
?>

@ -40,7 +40,7 @@ foreach ($usersRequested as $userRequested) {
$requestOptions[$userInfo['user_id']] = $userInfo['complete_name'];
}
$form = new FormValidator('require_user_vinculation');
$form = new FormValidator('require_user_linking');
$form->addUserAvatar('hrm', get_lang('DRH'), 'medium');
$form->addSelectAjax(
'users',
@ -65,7 +65,7 @@ if ($form->validate()) {
UserManager::requestUsersToHRManager($hrm->getId(), $usersId, false);
Display::addFlash(
Display::return_message(get_lang('RequestsVinculationAdded'), 'success')
Display::return_message(get_lang('LinkingRequestsAdded'), 'success')
);
header('Location: '.api_get_self());
@ -102,7 +102,7 @@ foreach ($usersAssigned as $userAssigned) {
$content .= '</div>';
$toolName = get_lang('RequireVinculationWithUser');
$toolName = get_lang('RequestLinkingToUser');
$view = new Template($toolName);
$view->assign('header', $toolName);

@ -502,16 +502,11 @@ Display :: display_header(get_lang('ToolSurvey'));
// Displaying the survey title and subtitle (appears on every page)
echo '<div class="survey-block">';
echo '<div id="survey_title">';
echo Display::return_icon(
'statistics.png',
get_lang('CreateNewSurvey'),
array('style'=>'display:inline-block; margin-right:5px;'),
ICON_SIZE_SMALL
);
echo strip_tags($survey_data['survey_title']).'</div>';
echo '<div class="page-header">';
echo '<h2>';
echo strip_tags($survey_data['survey_title']).'</h2></div>';
if (!empty($survey_data['survey_subtitle'])) {
echo '<div id="survey_subtitle">'.strip_tags($survey_data['survey_subtitle']).'</div>';
echo '<div class="survey_subtitle"><p>'.strip_tags($survey_data['survey_subtitle']).'</p></div>';
}
// Displaying the survey introduction
@ -522,7 +517,7 @@ if (!isset($_GET['show'])) {
$paged_questions_sec = array();
if (!empty($survey_data['survey_introduction'])) {
echo '<div id="survey_content" class="survey_content">'.$survey_data['survey_introduction'].'</div>';
echo '<div class="survey_content">'.$survey_data['survey_introduction'].'</div>';
}
$limit = 0;
}
@ -726,6 +721,7 @@ if (isset($_GET['show']) || isset($_POST['personality'])) {
$questions[$row['sort']]['type'] = $row['type'];
$questions[$row['sort']]['options'][$row['question_option_id']] = $row['option_text'];
$questions[$row['sort']]['maximum_score'] = $row['max_value'];
$questions[$row['sort']]['sort'] = $row['sort'];
} else {
// If the type is a pagebreak we are finished loading the questions for this page
break;
@ -1029,6 +1025,7 @@ if (isset($_GET['show']) || isset($_POST['personality'])) {
$questions[$row['sort']]['survey_group_sec1'] = $row['survey_group_sec1'];
$questions[$row['sort']]['survey_group_sec2'] = $row['survey_group_sec2'];
$questions[$row['sort']]['survey_group_pri'] = $row['survey_group_pri'];
$questions[$row['sort']]['sort'] = $row['sort'];
} else {
// If the type is a pagebreak we are finished loading the questions for this page
break;
@ -1150,12 +1147,14 @@ if (isset($_GET['show']) || isset($_POST['personality'])) {
$questions[$row['sort']]['survey_group_sec1'] = $row['survey_group_sec1'];
$questions[$row['sort']]['survey_group_sec2'] = $row['survey_group_sec2'];
$questions[$row['sort']]['survey_group_pri'] = $row['survey_group_pri'];
$questions[$row['sort']]['sort'] = $row['sort'];
} else {
// If the type is a page break we are finished loading the questions for this page
break;
}
$counter++;
}
var_Dump($questions);
}
}
} else { // In case it's another type than 0 or 1
@ -1195,7 +1194,7 @@ $p_l = isset($_POST['language']) ? Security::remove_XSS($_POST['language']) : ''
$add_parameters = isset($_GET['user_id']) ? 'user_id='.intval($_GET['user_id']).'&amp;' : '';
$url = api_get_self().'?'.api_get_cidreq().'&'.$add_parameters.'course='.$g_c.'&invitationcode='.$g_ic.'&show='.$show;
$form = new FormValidator('question', 'post', $url);
$form = new FormValidator('question', 'post', $url, null, null, FormValidator::LAYOUT_INLINE);
$form->addHidden('language', $p_l);
if (isset($questions) && is_array($questions)) {
@ -1203,25 +1202,28 @@ if (isset($questions) && is_array($questions)) {
$ch_type = 'ch_'.$question['type'];
$display = new $ch_type;
// @todo move this in a function.
$form->addHtml('<div class="survey_question_wrapper"><div class="survey_question">');
$form->addHtml($question['survey_question']);
$form->addHtml('<div class="survey_question '.$ch_type.'">');
//$form->addHtml('<div class="survey_question_wrapper"><div class="survey_question">');
$form->addHtml('<h5 class="title">'.$question['sort'].'. '.strip_tags($question['survey_question']).'</h5>');
//$form->addHtml($question['survey_question']);
$display->render($form, $question);
$form->addHtml('</div></div>');
$form->addHtml('</div>');
}
}
$form->addHtml('<div class="start-survey">');
if ($survey_data['survey_type'] === '0') {
if ($survey_data['show_form_profile'] == 0) {
// The normal survey as always
if (($show < $numberofpages) || !$_GET['show']) {
if ($show == 0) {
$form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large');
$form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success');
} else {
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right');
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right', 'success');
}
}
if ($show >= $numberofpages && $_GET['show']) {
$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right', 'success');
}
} else {
// The normal survey as always but with the form profile
@ -1229,14 +1231,14 @@ if ($survey_data['survey_type'] === '0') {
$numberofpages = count($paged_questions);
if (($show < $numberofpages) || !$_GET['show']) { //$show = $_GET['show'] + 1
if ($show == 0) {
$form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large');
$form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success');
} else {
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right');
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right', 'success');
}
}
if ($show >= $numberofpages && $_GET['show']) {
$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right', 'success');
}
}
}
@ -1255,7 +1257,7 @@ if ($survey_data['survey_type'] === '0') {
if ($personality == 0) {
if (($show <= $numberofpages) || !$_GET['show']) {
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right');
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right', 'success');
if ($survey_data['one_question_per_page'] == 0) {
if ($personality >= 0) {
$form->addHidden('personality', $personality);
@ -1277,10 +1279,10 @@ if ($survey_data['survey_type'] === '0') {
} elseif ($personality > 0) {
if ($survey_data['one_question_per_page'] == 1) {
if ($show >= $numberofpages) {
$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right');
$form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right', 'success');
} else {
$form->addHidden('personality', $personality);
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right');
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right', 'success');
}
} else {
// if the personality test hidden input was set.
@ -1289,12 +1291,13 @@ if ($survey_data['survey_type'] === '0') {
}
} elseif ($survey_data['form_fields'] == '') {
// This is the case when the show_profile_form is true but there are not form_fields
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right');
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right', 'success');
} elseif (!is_array($user_data)) {
// If the user is not registered in the platform we do not show the form to update his information
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right');
$form->addButton('next_survey_page', get_lang('Next'), 'arrow-right', 'success');
}
}
$form->addHtml('</div>');
$form->display();
// Footer

@ -22,6 +22,7 @@ $table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
$course_id = api_get_course_int_id();
$courseInfo = $course_id ? api_get_course_info_by_id($course_id) : [];
$userId = api_get_user_id();
$surveyId = intval($_GET['survey_id']);
$userInvited = 0;
@ -206,7 +207,7 @@ if (api_is_course_admin() ||
$url = api_get_self().'?survey_id='.$survey_id.'&show='.$show;
$form = new FormValidator('question-survey', 'post', $url, null, null, FormValidator::LAYOUT_INLINE);
if (is_array($questions) && count($questions) > 0) {
foreach ($questions as $key => & $question) {
$ch_type = 'ch_'.$question['type'];
@ -251,6 +252,14 @@ if (api_is_course_admin() ||
}
$form->addHtml('</div>');
$form->display();
if ($courseInfo) {
echo Display::toolbarButton(
get_lang('ReturnToCourseHomepage'),
api_get_course_url($courseInfo['code']),
'home'
);
}
} else {
echo Display::return_message(get_lang('NotAllowed'), 'error', false);
}

@ -2511,9 +2511,18 @@ class SurveyUtil
$table->set_header(6, get_lang('AvailableUntil'));
$table->set_header(7, get_lang('Invite'));
$table->set_header(8, get_lang('Anonymous'));
$table->set_header(9, get_lang('Modify'), false, 'width="150"');
if (api_get_configuration_value('allow_mandatory_survey')) {
$table->set_header(9, get_lang('IsMandatory'));
$table->set_header(10, get_lang('Modify'), false, 'width="150"');
$table->set_column_filter(9, 'anonymous_filter');
$table->set_column_filter(10, 'modify_filter_drh');
} else {
$table->set_header(9, get_lang('Modify'), false, 'width="150"');
$table->set_column_filter(9, 'modify_filter_drh');
}
$table->set_column_filter(8, 'anonymous_filter');
$table->set_column_filter(9, 'modify_filter_drh');
$table->display();
}
@ -2554,9 +2563,18 @@ class SurveyUtil
$table->set_header(6, get_lang('AvailableUntil'));
$table->set_header(7, get_lang('Invite'));
$table->set_header(8, get_lang('Anonymous'));
$table->set_header(9, get_lang('Modify'), false, 'width="150"');
if (api_get_configuration_value('allow_mandatory_survey')) {
$table->set_header(9, get_lang('IsMandatory'));
$table->set_header(10, get_lang('Modify'), false, 'width="150"');
$table->set_column_filter(9, 'anonymous_filter');
$table->set_column_filter(10, 'modify_filter');
} else {
$table->set_header(9, get_lang('Modify'), false, 'width="150"');
$table->set_column_filter(9, 'modify_filter');
}
$table->set_column_filter(8, 'anonymous_filter');
$table->set_column_filter(9, 'modify_filter');
$table->set_form_actions(array('delete' => get_lang('DeleteSurvey')));
$table->display();
}
@ -2593,9 +2611,18 @@ class SurveyUtil
$table->set_header(6, get_lang('AvailableUntil'));
$table->set_header(7, get_lang('Invite'));
$table->set_header(8, get_lang('Anonymous'));
$table->set_header(9, get_lang('Modify'), false, 'width="130"');
if (api_get_configuration_value('allow_mandatory_survey')) {
$table->set_header(9, get_lang('Modify'), false, 'width="130"');
$table->set_header(10, get_lang('Modify'), false, 'width="130"');
$table->set_column_filter(9, 'anonymous_filter');
$table->set_column_filter(10, 'modify_filter_for_coach');
} else {
$table->set_header(9, get_lang('Modify'), false, 'width="130"');
$table->set_column_filter(9, 'modify_filter_for_coach');
}
$table->set_column_filter(8, 'anonymous_filter');
$table->set_column_filter(9, 'modify_filter_for_coach');
$table->display();
}
@ -2766,6 +2793,7 @@ class SurveyUtil
$table_survey = Database::get_course_table(TABLE_SURVEY);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
$mandatoryAllowed = api_get_configuration_value('allow_mandatory_survey');
$_user = api_get_user_info();
// Searching
@ -2814,6 +2842,8 @@ class SurveyUtil
$res = Database::query($sql);
$surveys = array();
$array = array();
$efv = new ExtraFieldValue('survey');
while ($survey = Database::fetch_array($res)) {
$array[0] = $survey[0];
$array[1] = Display::url(
@ -2839,7 +2869,15 @@ class SurveyUtil
);
$array[8] = $survey[8];
$array[9] = $survey[9];
if ($mandatoryAllowed) {
$efvMandatory = $efv->get_values_by_handler_and_field_variable($survey[9], 'is_mandatory');
$array[9] = $efvMandatory ? $efvMandatory['value'] : 0;
$array[10] = $survey[9];
} else {
$array[9] = $survey[9];
}
if ($isDrh) {
$array[1] = $survey[1];
@ -2860,6 +2898,7 @@ class SurveyUtil
*/
public static function get_survey_data_for_coach($from, $number_of_items, $column, $direction)
{
$mandatoryAllowed = api_get_configuration_value('allow_mandatory_survey');
$survey_tree = new SurveyTree();
//$last_version_surveys = $survey_tree->get_last_children_from_branch($survey_tree->surveylist);
$last_version_surveys = $survey_tree->surveylist;
@ -2884,6 +2923,7 @@ class SurveyUtil
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$course_id = api_get_course_int_id();
$efv = new ExtraFieldValue('survey');
$sql = "SELECT
survey.survey_id AS col0,
@ -2908,6 +2948,11 @@ class SurveyUtil
$res = Database::query($sql);
$surveys = array();
while ($survey = Database::fetch_array($res)) {
if ($mandatoryAllowed) {
$survey['col10'] = $survey['col9'];
$efvMandatory = $efv->get_values_by_handler_and_field_variable($survey['col9'], 'is_mandatory');
$survey['col9'] = $efvMandatory['value'];
}
$surveys[] = $survey;
}
@ -2928,6 +2973,7 @@ class SurveyUtil
$course_id = $_course['real_id'];
$user_id = intval($user_id);
$sessionId = api_get_session_id();
$mandatoryAllowed = api_get_configuration_value('allow_mandatory_survey');
// Database table definitions
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
@ -2949,6 +2995,9 @@ class SurveyUtil
echo '<tr>';
echo ' <th>'.get_lang('SurveyName').'</th>';
echo ' <th class="text-center">'.get_lang('Anonymous').'</th>';
if ($mandatoryAllowed) {
echo '<th class="text-center">'.get_lang('IsMandatory').'</th>';
}
echo '</tr>';
echo '</thead>';
echo '<tbody>';
@ -2972,6 +3021,8 @@ class SurveyUtil
";
$result = Database::query($sql);
$efv = new ExtraFieldValue('survey');
while ($row = Database::fetch_array($result, 'ASSOC')) {
echo '<tr>';
if ($row['answered'] == 0) {
@ -2999,6 +3050,11 @@ class SurveyUtil
echo '<td class="text-center">';
echo ($row['anonymous'] == 1) ? get_lang('Yes') : get_lang('No');
echo '</td>';
if ($mandatoryAllowed) {
$efvMandatory = $efv->get_values_by_handler_and_field_variable($row['survey_id'], 'is_mandatory');
echo '<td class="text-center">'.($efvMandatory['value'] ? get_lang('Yes') : get_lang('No')).'</td>';
}
echo '</tr>';
}
echo '</tbody>';

@ -1,4 +1,6 @@
<h4 class="page-header">{{ "SystemAnnouncements" | get_lang }}</h4>
<div class="page-header">
<h4>{{ "SystemAnnouncements" | get_lang }}</h4>
</div>
<div id="carousel-announcement" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">

@ -1,4 +1,6 @@
<h2 class="page-header">{{ "SystemAnnouncements" | get_lang }}</h2>
<div class="page-header">
<h4>{{ "SystemAnnouncements" | get_lang }}</h4>
</div>
{% if not announcement is empty %}
<article id="announcement-{{ announcement.id }}}">

@ -21,7 +21,7 @@ $(document).ready( function() {
});
</script>
<section class="hot-courses">
<div class="hot-course-head">
<div class="page-header">
<h4 class="hot-course-title">
{{ "HottestCourses"|get_lang}}
{% if _u.is_admin %}

@ -253,4 +253,21 @@ class ScriptHandler
return $res;
}
/**
* Update the basis css files.
* Avoid use the ScriptHandler::dumpCssFiles
*/
public static function updateCss()
{
$appCss = __DIR__.'/../../../../app/Resources/public/css/';
$newPath = __DIR__.'/../../../../web/css/';
$cssFiles = ['base.css', 'chat.css', 'editor.css', 'markdown.css', 'print.css', 'responsive.css', 'scorm.css'];
$fs = new Filesystem();
foreach ($cssFiles as $file) {
$fs->copy($appCss.$file, $newPath.$file, true);
}
}
}

Loading…
Cancel
Save