Browse Source

Fix settings + use iso language instead of language name

Julio Montoya 9 years ago
parent
commit
53bbbe6bb2
43 changed files with 803 additions and 102 deletions
  1. 1 1
      main/admin/course_add.php
  2. 1 1
      main/admin/course_list.php
  3. 1 1
      main/admin/legal_list.php
  4. 2 9
      main/admin/system_announcements.php
  5. 4 2
      main/course_home/course_home.php
  6. 5 2
      main/exercice/admin.php
  7. 2 4
      main/exercice/stats.php
  8. 14 20
      main/inc/lib/api.lib.php
  9. 19 16
      main/inc/lib/course.lib.php
  10. 10 9
      main/inc/lib/formvalidator/Element/SelectLanguage.php
  11. 16 7
      main/inc/lib/social.lib.php
  12. 3 4
      main/inc/lib/usermanager.lib.php
  13. 16 11
      main/social/home.php
  14. 1 1
      main/user/add_users_to_session.php
  15. 1 1
      main/user/resume_session.php
  16. 1 1
      main/user/session_list.php
  17. 2 2
      main/user/user.php
  18. 1 1
      plugin/before_login/plugin.php
  19. 5 1
      src/Chamilo/CoreBundle/Resources/config/routing.yml
  20. 1 1
      src/Chamilo/CoreBundle/Resources/views/default/exercise/submit.html.twig
  21. 15 0
      src/Chamilo/CoreBundle/Resources/views/default/social/add_groups.tpl
  22. 26 0
      src/Chamilo/CoreBundle/Resources/views/default/social/avatar_block.tpl
  23. 15 0
      src/Chamilo/CoreBundle/Resources/views/default/social/edit_profile.tpl
  24. 51 0
      src/Chamilo/CoreBundle/Resources/views/default/social/form_modals.tpl
  25. 29 0
      src/Chamilo/CoreBundle/Resources/views/default/social/friends.tpl
  26. 1 0
      src/Chamilo/CoreBundle/Resources/views/default/social/group_block.tpl
  27. 32 0
      src/Chamilo/CoreBundle/Resources/views/default/social/group_view.tpl
  28. 45 0
      src/Chamilo/CoreBundle/Resources/views/default/social/group_waiting_list.tpl
  29. 15 0
      src/Chamilo/CoreBundle/Resources/views/default/social/groups.tpl
  30. 84 0
      src/Chamilo/CoreBundle/Resources/views/default/social/home.html.twig
  31. 15 0
      src/Chamilo/CoreBundle/Resources/views/default/social/inbox.tpl
  32. 15 0
      src/Chamilo/CoreBundle/Resources/views/default/social/invitations.tpl
  33. 24 0
      src/Chamilo/CoreBundle/Resources/views/default/social/myfiles.tpl
  34. 121 0
      src/Chamilo/CoreBundle/Resources/views/default/social/profile.tpl
  35. 26 0
      src/Chamilo/CoreBundle/Resources/views/default/social/search.tpl
  36. 69 0
      src/Chamilo/CoreBundle/Resources/views/default/social/skills_block.tpl
  37. 79 0
      src/Chamilo/CoreBundle/Resources/views/default/social/user_block.tpl
  38. 21 0
      src/Chamilo/CoreBundle/Resources/views/default/social/whoisonline.tpl
  39. 4 3
      src/Chamilo/CoreBundle/Settings/LanguageSettingsSchema.php
  40. 2 2
      src/Chamilo/CoreBundle/Settings/MessageSettingsSchema.php
  41. 3 0
      src/Chamilo/CoreBundle/Settings/SessionSettingsSchema.php
  42. 1 1
      src/Chamilo/CoreBundle/Settings/SocialSettingsSchema.php
  43. 4 1
      src/Chamilo/CourseBundle/Controller/Home/HomeController.php

+ 1 - 1
main/admin/course_add.php

@@ -185,7 +185,7 @@ if ($form->validate()) {
 }
 
 // Display the form.
-$content = $form->return_form();
+$content = $form->returnForm();
 
 echo $content;
 

+ 1 - 1
main/admin/course_list.php

@@ -152,7 +152,7 @@ function get_course_data($from, $number_of_items, $column, $direction)
         $course[5] = $course[5] == SUBSCRIBE_ALLOWED ? get_lang('Yes') : get_lang('No');
         $course[6] = $course[6] == UNSUBSCRIBE_ALLOWED ? get_lang('Yes') : get_lang('No');
 
-        $language = isset($languages[$course[3]]) ? $languages[$course[3]] : $course[3];
+        $language = isset($languages[$course['col3']]) ? $languages[$course['col3']] : $course['col3'];
 
         $course_rem = array(
             $course[0],

+ 1 - 1
main/admin/legal_list.php

@@ -32,7 +32,7 @@ if (isset ($_GET['action'])) {
 $legal_count = LegalManager::count();
 
 $languages = api_get_languages();
-$available_languages = count($languages['folder']);
+$available_languages = count($languages);
 if ($legal_count != $available_languages) {
     Display::display_warning_message(get_lang('YouShouldCreateTermAndConditionsForAllAvailableLanguages'));
 }

+ 2 - 9
main/admin/system_announcements.php

@@ -132,16 +132,9 @@ if ($action_todo) {
         $url = api_get_self().'?id='.intval($_GET['id']);
     }
     $form = new FormValidator('system_announcement', 'post', $url);
-    $form->addElement('header', '', $form_title);
+    $form->addElement('header', $form_title);
     $form->addText('title', get_lang('Title'), true);
-    $language_list = api_get_languages();
-    $language_list_with_keys = array();
-    $language_list_with_keys['all'] = get_lang('All');
-    for ($i=0; $i<count($language_list['name']) ; $i++) {
-        $language_list_with_keys[$language_list['folder'][$i]] = $language_list['name'][$i];
-    }
-
-    $form->addElement('select', 'lang',get_lang('Language'), $language_list_with_keys);
+    $form->addElement('select_language', 'lang', get_lang('Language'));
     $form->addHtmlEditor(
         'content',
         get_lang('Content'),

+ 4 - 2
main/course_home/course_home.php

@@ -248,12 +248,14 @@ $reqdate = "&reqdate=$temps";
 /*	MAIN CODE */
 
 /*	Introduction section (editable by course admins) */
-$content = Display::return_introduction_section(TOOL_COURSE_HOMEPAGE, array(
+/*$content = Display::return_introduction_section(
+    TOOL_COURSE_HOMEPAGE,
+    array(
 		'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/',
 		'CreateDocumentDir'    => 'document/',
 		'BaseHref'             => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/'
 	)
-);
+);*/
 
 /*	SWITCH TO A DIFFERENT HOMEPAGE VIEW
 	the setting homepage_view is adjustable through

+ 5 - 2
main/exercice/admin.php

@@ -340,7 +340,10 @@ $htmlHeadXtra[] = api_get_js('jquery.jsPlumb.all.js');
 
 $template = \Chamilo\CoreBundle\Framework\Container::getTwig();
 
-$htmlHeadXtra[] = $template->fetch('default/exercise/submit.js.tpl');
+$htmlHeadXtra[] = $template->render(
+    'ChamiloCoreBundle:default/exercise:submit.html.twig',
+    ['shuffle_answers' => $objExercise->getShuffle()]
+);
 $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');
 
 $htmlHeadXtra[] = "<script type=\"text/javascript\" src=\"../plugin/hotspot/JavaScriptFlashGateway.js\"></script>
@@ -456,7 +459,7 @@ function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
 // -->
 </script>";
 
-Display::display_header($nameTools,'Exercise');
+//Display::display_header($nameTools,'Exercise');
 /*
 if ($objExercise->exercise_was_added_in_lp) {
     if ($objExercise->force_edit_exercise_in_lp == true) {

+ 2 - 4
main/exercice/stats.php

@@ -283,10 +283,8 @@ $interbreadcrumb[] = array(
     "name" => $objExercise->name,
 );
 
-$tpl = new Template(get_lang('ReportByQuestion'));
+//$tpl = new Template(get_lang('ReportByQuestion'));
 $actions = '<a href="exercise_report.php?exerciseId='.intval($_GET['exerciseId']).'&'.api_get_cidreq().'">' .
     Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
 $actions = Display::div($actions, array('class'=> 'actions'));
-$content = $actions.$content;
-$tpl->assign('content', $content);
-$tpl->display_one_col_template();
+echo $actions.$content;

+ 14 - 20
main/inc/lib/api.lib.php

@@ -2586,7 +2586,6 @@ function api_get_setting_in_list($variable, $option)
 function api_get_setting($variable)
 {
     $variable = trim($variable);
-
     switch ($variable) {
         case 'server_type':
             $test = ['dev', 'test'];
@@ -2597,8 +2596,7 @@ function api_get_setting($variable)
 
             return 'prod';
         case 'stylesheets':
-            return 'platform.theme';
-            break;
+            $variable = 'platform.theme';
         default:
             return Container::getSettingsManager()->getSetting($variable);
     }
@@ -4317,27 +4315,25 @@ function api_get_languages_combo($name = 'language') {
     $ret = '';
 
     // Retrieve a complete list of all the languages.
-    $language_list = api_get_languages();
+    $languages = api_get_languages();
 
-    if (count($language_list['name']) < 2) {
+    if (count($languages) < 2) {
         return $ret;
     }
 
     $default = api_get_user_language();
 
-    $languages  = $language_list['name'];
-    $folder     = $language_list['folder'];
-
     $ret .= '<select name="' . $name . '" id="language_chosen">';
-    foreach ($languages as $key => $value) {
-        if ($folder[$key] == $default) {
+    foreach ($languages as $iso => $value) {
+        if ($iso == $default) {
             $selected = ' selected="selected"';
         } else {
             $selected = '';
         }
-        $ret .= sprintf('<option value=%s" %s>%s</option>', $folder[$key], $selected, $value);
+        $ret .= sprintf('<option value=%s" %s>%s</option>', $iso, $selected, $value);
     }
     $ret .= '</select>';
+
     return $ret;
 }
 
@@ -4383,14 +4379,12 @@ function api_display_language_form($hide_if_no_choice = false)
 {
     // Retrieve a complete list of all the languages.
     $language_list = api_get_languages();
-    if (count($language_list['name']) <= 1 && $hide_if_no_choice) {
+    if (count($language_list) <= 1 && $hide_if_no_choice) {
         return; //don't show any form
     }
 
     $user_selected_language = api_get_language_selected_in_login();
 
-    $original_languages = $language_list['name'];
-    $folder = $language_list['folder']; // This line is probably no longer needed.
     $html = '
     <script type="text/javascript">
     <!--
@@ -4410,13 +4404,13 @@ function api_display_language_form($hide_if_no_choice = false)
     $html .= '<label style="display: none;" for="language_list">' . get_lang('Language') . '</label>';
     $html .=  '<select id="language_list" class="selectpicker show-tick form-control" name="language_list" >';
 
-    foreach ($original_languages as $key => $value) {
-        if ($folder[$key] == $user_selected_language) {
+    foreach ($language_list as $iso => $value) {
+        if ($iso == $user_selected_language) {
             $option_end = ' selected="selected" >';
         } else {
             $option_end = '>';
         }
-        $html .=  '<option value="'.api_get_self().'?language='.$folder[$key].'"'.$option_end;
+        $html .=  '<option value="'.api_get_self().'?language='.$iso.'"'.$option_end;
         //echo substr($value, 0, 16); // Cut string to keep 800x600 aspect.
         $html .=  $value.'</option>';
     }
@@ -4450,8 +4444,8 @@ function api_get_languages() {
     $result = Database::query($sql);
     $language_list = array();
     while ($row = Database::fetch_array($result)) {
-        $language_list['name'][] = $row['original_name'];
-        $language_list['folder'][] = $row['dokeos_folder'];
+        //var_dump($row);
+        $language_list[$row['isocode']] = $row['original_name'];
     }
     return $language_list;
 }
@@ -4466,7 +4460,7 @@ function api_get_languages_to_array() {
     $result = Database::query($sql);
     $languages = array();
     while ($row = Database::fetch_array($result)) {
-        $languages[$row['dokeos_folder']] = $row['original_name'];
+        $languages[$row['isocode']] = $row['original_name'];
     }
     return $languages;
 }

+ 19 - 16
main/inc/lib/course.lib.php

@@ -2229,22 +2229,6 @@ class CourseManager
 
             $course_tables = AddCourse::get_course_tables();
 
-            // Cleaning group categories
-            $groupCategories = GroupManager::get_categories($course['code']);
-
-            if (!empty($groupCategories)) {
-                foreach ($groupCategories as $category) {
-                    GroupManager::delete_category($category['id'], $course['code']);
-                }
-            }
-
-            // Cleaning groups
-            $groups = GroupManager::get_groups();
-            if (!empty($groups)) {
-                $groupList = array_column($groups, 'id');
-                GroupManager::delete_groups($groupList);
-            }
-
             // Cleaning c_x tables
             if (!empty($courseId)) {
                 foreach ($course_tables as $table) {
@@ -2285,6 +2269,23 @@ class CourseManager
                 Database::query($sql);
             }
 
+            // Cleaning group categories
+            $groupCategories = GroupManager::get_categories($course['code']);
+
+            if (!empty($groupCategories)) {
+                foreach ($groupCategories as $category) {
+                    GroupManager::delete_category($category['id'], $course['code']);
+                }
+            }
+
+            // Cleaning groups
+            $groups = GroupManager::get_groups();
+            if (!empty($groups)) {
+                $groupList = array_column($groups, 'id');
+                GroupManager::delete_groups($groupList);
+            }
+
+
             // Delete the course from the stats tables
 
             $sql = "DELETE FROM $table_stats_hotpots WHERE c_id = $courseId";
@@ -2317,6 +2318,8 @@ class CourseManager
             $sql = "DELETE FROM $table_course WHERE code = '" . $codeFiltered . "'";
             Database::query($sql);
 
+
+
             // delete extra course fields
             $extraFieldValues = new ExtraFieldValue('course');
             $extraFieldValues->deleteValuesByItem($courseId);

+ 10 - 9
main/inc/lib/formvalidator/Element/SelectLanguage.php

@@ -9,21 +9,22 @@ class SelectLanguage extends HTML_QuickForm_select
 	/**
 	 * Class constructor
 	 */
-	function SelectLanguage($elementName=null, $elementLabel=null, $options=null, $attributes=null)
-	{
+    function SelectLanguage(
+        $elementName = null,
+        $elementLabel = null,
+        $options = null,
+        $attributes = null
+    ) {
 		parent::__construct($elementName, $elementLabel, $options, $attributes);
 		// Get all languages
 		$languages = api_get_languages();
 		$this->_options = array();
 		$this->_values = array();
-		foreach ($languages['name'] as $index => $name) {
-			if ($languages['folder'][$index] == api_get_setting(
-							'language.platform_language'
-					)
-			) {
-				$this->addOption($name,$languages['folder'][$index],array('selected'=>'selected'));
+		foreach ($languages as $iso => $name) {
+			if ($iso == api_get_setting('language.platform_language')) {
+				$this->addOption($name, $iso, array('selected'=>'selected'));
 			} else {
-				$this->addOption($name,$languages['folder'][$index]);
+				$this->addOption($name, $iso);
 			}
 		}
 	}

+ 16 - 7
main/inc/lib/social.lib.php

@@ -1646,7 +1646,13 @@ class SocialManager extends UserManager
      * @param boolean $show_full_profile - Optional. Shows the Full Profile or Not
      * @return string The HTML code with the social block
      */
-    public static function setSocialUserBlock(Template $template, $userId, $groupBlock = '', $groupId = 0, $show_full_profile = true)
+    public static function setSocialUserBlock(
+        $template,
+        $userId,
+        $groupBlock = '',
+        $groupId = 0,
+        $show_full_profile = true
+    )
     {
         if (api_get_setting('social.allow_social_tool') != 'true') {
             return '';
@@ -1667,14 +1673,14 @@ class SocialManager extends UserManager
 
         $userInfo = api_get_user_info($userId, true, false, true);
 
-        $template->assign('user', $userInfo);
-        $template->assign('social_avatar_block', $socialAvatarBlock);
-        $template->assign('profile_edition_link', $profileEditionLink);
+        $template->addGlobal('user', $userInfo);
+        $template->addGlobal('social_avatar_block', $socialAvatarBlock);
+        $template->addGlobal('profile_edition_link', $profileEditionLink);
 
         //If not friend $show_full_profile is False and the user can't see Email Address and Vcard Download Link
         if ($show_full_profile) {
             //Added the link to export the vCard to the Template
-            $template->assign('vcard_user_link', $vCardUserLink);
+            $template->addGlobal('vcard_user_link', $vCardUserLink);
         }
 
         if (api_get_setting('platform.gamification_mode') === '1') {
@@ -1683,7 +1689,7 @@ class SocialManager extends UserManager
                 $userInfo['status']
             );
 
-            $template->assign('gamification_points', $gamificationPoints);
+            $template->addGlobal('gamification_points', $gamificationPoints);
         }
         $chatEnabled = api_is_global_chat_enabled();
         $template->assign('chat_enabled', $chatEnabled);
@@ -1693,7 +1699,10 @@ class SocialManager extends UserManager
             $templateName = $template->get_template('social/group_block.tpl');
         }
 
-        $template->assign('social_avatar_block', $template->fetch($templateName));
+        $template->addGlobal(
+            'social_avatar_block',
+            $template->fetch($templateName)
+        );
     }
 
     /**

+ 3 - 4
main/inc/lib/usermanager.lib.php

@@ -112,7 +112,7 @@ class UserManager
      * @param  string Login
      * @param  string Password
      * @param  string Any official code (optional)
-     * @param  string User language    (optional)
+     * @param  string User language    (optional) (isocode)
      * @param  string Phone number    (optional)
      * @param  string Picture URI        (optional)
      * @param  string Authentication source    (optional, defaults to 'platform', dependind on constant)
@@ -201,8 +201,7 @@ class UserManager
 
         //Checking the user language
         $languages = api_get_languages();
-        $language = strtolower($language);
-        if (!in_array($language, $languages['folder'])) {
+        if (!in_array($language, array_keys($languages))) {
             $language = api_get_setting('language.platform_language');
         }
 
@@ -759,7 +758,7 @@ class UserManager
 
         //Checking the user language
         $languages = api_get_languages();
-        if (!in_array($language, $languages['folder'])) {
+        if (!in_array($language, array_keys($languages))) {
             $language = api_get_setting('language.platform_language');
         }
 

+ 16 - 11
main/social/home.php

@@ -16,7 +16,6 @@ $this_section = SECTION_SOCIAL;
 unset($_SESSION['this_section']);
 
 api_block_anonymous_users();
-
 if (api_get_setting('social.allow_social_tool') != 'true') {
     $url = api_get_path(WEB_CODE_PATH) . 'auth/profile.php';
     header('Location: ' . $url);
@@ -26,7 +25,11 @@ if (api_get_setting('social.allow_social_tool') != 'true') {
 $userGroup = new UserGroup();
 
 //fast upload image
-if (api_get_setting('profile', 'picture') == 'true') {
+if (api_get_setting_in_list(
+        'profile.changeable_options',
+        'picture'
+    ) == 'true'
+) {
     $form = new FormValidator('profile', 'post', 'home.php', null, array());
 
     //	PICTURE
@@ -205,14 +208,16 @@ if (count($sessionList) > 0) {
 
 $social_group_block = Display::panelCollapse(get_lang('Group'), $social_group_block, 'sm-groups', null, 'grups-acordion', 'groups-collapse');
 
-$tpl = new Template(get_lang('SocialNetwork'));
+//$tpl =  new Template(get_lang('SocialNetwork'));
+$tpl = \Chamilo\CoreBundle\Framework\Container::getTwig();
 SocialManager::setSocialUserBlock($tpl, api_get_user_id(), 'home');
 
-$tpl->assign('social_menu_block', $social_menu_block);
-$tpl->assign('social_friend_block', $friend_html);
-$tpl->assign('sessionList', $social_session_block);
-$tpl->assign('social_search_block', $social_search_block);
-$tpl->assign('social_skill_block', SocialManager::getSkillBlock($user_id));
-$tpl->assign('social_group_block', $social_group_block);
-$social_layout = $tpl->get_template('social/home.tpl');
-$tpl->display($social_layout);
+$tpl->addGlobal('social_menu_block', $social_menu_block);
+$tpl->addGlobal('social_friend_block', $friend_html);
+$tpl->addGlobal('sessionList', $social_session_block);
+$tpl->addGlobal('social_search_block', $social_search_block);
+$tpl->addGlobal('social_skill_block', SocialManager::getSkillBlock($user_id));
+$tpl->addGlobal('social_group_block', $social_group_block);
+
+echo $tpl->render('@ChamiloCore/default/social/home.html.twig');
+

+ 1 - 1
main/user/add_users_to_session.php

@@ -26,7 +26,7 @@ if (api_is_platform_admin()) {
     $interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
     $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session,"name" => get_lang('SessionOverview'));
 }
-$allowTutors = api_get_setting('allow_tutors_to_assign_students_to_session');
+$allowTutors = api_get_setting('session.allow_tutors_to_assign_students_to_session');
 if($allowTutors == 'true') {
     // Database Table Definitions
     $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);

+ 1 - 1
main/user/resume_session.php

@@ -16,7 +16,7 @@ SessionManager::protect_teacher_session_edit($id_session);
 
 $tool_name = get_lang('SessionOverview');
 
-$allowTutors = api_get_setting('allow_tutors_to_assign_students_to_session');
+$allowTutors = api_get_setting('session.allow_tutors_to_assign_students_to_session');
 if ($allowTutors == 'true') {
     // Database Table Definitions
     $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);

+ 1 - 1
main/user/session_list.php

@@ -22,7 +22,7 @@ $idChecked = $_REQUEST['idChecked'];
 $tool_name = get_lang('SessionList');
 Display::display_header($tool_name);
 
-$allowTutors = api_get_setting('allow_tutors_to_assign_students_to_session');
+$allowTutors = api_get_setting('session.allow_tutors_to_assign_students_to_session');
 if ($allowTutors == 'true') {
 
     $error_message = ''; // Avoid conflict with the global variable $error_msg (array type) in add_course.conf.php.

+ 2 - 2
main/user/user.php

@@ -960,7 +960,7 @@ if (isset($origin) && $origin == 'learnpath') {
 $is_allowed_to_track = ($is_courseAdmin || $is_courseTutor);
 
 // Tool introduction
-Display::display_introduction_section(TOOL_USER, 'left');
+Display::display_introduction_section(TOOL_USER);
 $actions = '';
 $selectedTab = 1;
 
@@ -1019,7 +1019,7 @@ if (api_is_allowed_to_edit(null, true)) {
     echo '</div>';
     echo '</div>';
 
-    $allowTutors = api_get_setting('allow_tutors_to_assign_students_to_session');
+    $allowTutors = api_get_setting('session.allow_tutors_to_assign_students_to_session');
     if (api_is_allowed_to_edit() && $allowTutors == 'true') {
         $actions .= ' <a class="btn btn-default" href="session_list.php?'.api_get_cidreq().'">'.
             get_lang('Sessions').'</a>';

+ 1 - 1
plugin/before_login/plugin.php

@@ -20,7 +20,7 @@ $plugin_info['author']      = 'Julio Montoya';
 
 // The plugin configuration.
 $form = new FormValidator('form');
-$form->addElement('select', 'language', get_lang('Language'), api_get_languages_to_array());
+$form->addElement('select_language', 'language', get_lang('Language'));
 
 $form->addElement('header', 'Option 1');
 $form->addElement('textarea', 'option1', get_lang('Description'), array('rows' => 10, 'class' => 'span6'));

+ 5 - 1
src/Chamilo/CoreBundle/Resources/config/routing.yml

@@ -47,7 +47,10 @@ core_admin:
 #    resource: "@ChamiloCoreBundle/Controller/App"
 #    type: annotation
 #    prefix:   /app
-#
+
+course_url:
+    path: courses
+
 core_tool:
     resource: "@ChamiloCourseBundle/Controller"
     type: annotation
@@ -55,6 +58,7 @@ core_tool:
 
 # redirects /url/ to /url
 
+
 remove_trailing_slash:
     path: /{url}
     defaults: { _controller: ChamiloCoreBundle:Redirecting:removeTrailingSlash }

+ 1 - 1
main/template/default/exercise/submit.js.tpl → src/Chamilo/CoreBundle/Resources/views/default/exercise/submit.html.twig

@@ -28,7 +28,7 @@ var DraggableAnswer = {
                     .attr('href', '#')
                     .addClass('btn btn-default btn-xs')
                     .append(
-                        "{{ "Undo" | get_lang }} ",
+                        "{{ "Undo" | trans }} ",
                         $('<i>').addClass('fa fa-undo')
                     )
                     .on('click', function (e) {

+ 15 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/add_groups.tpl

@@ -0,0 +1,15 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            <div class="social-network-menu">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div class="col-md-9">
+            {{ social_right_content }}
+        </div>
+    </div>
+{% endblock %}

+ 26 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/avatar_block.tpl

@@ -0,0 +1,26 @@
+<div class="social-profile text-center">
+    {% if show_group %}
+        <img src="{{ user_group_image.file }}"
+             class="img-profile img-responsive img-circle">
+        <div class="caption">
+            <h4 class="group-title">
+                <a href="{{ _p.web_main ~ 'social/group_view.php?id=' ~ group_id }}">{{ user_group.name }}</a>
+            </h4>
+
+            <p class="group-description">{{ user_group.description }}</p>
+            {% if user_is_group_admin %}
+                <div id="edit_image">
+                    <a class="btn btn-default"
+                       href="{{ _p.web_main ~ 'social/group_edit.php?id=' ~ group_id }}">
+                        {{ 'EditGroup'|get_lang }}
+                    </a>
+                </div>
+            {% endif %}
+        </div>
+    {% elseif show_user %}
+        <a href="{{ user_image.big }}" class="expand-image">
+            <img class="img-responsive img-circle"
+                 src="{{ user_image.normal }}">
+        </a>
+    {% endif %}
+</div>

+ 15 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/edit_profile.tpl

@@ -0,0 +1,15 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            <div class="social-network-menu">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div class="col-md-9">
+            {{ social_right_content }}
+        </div>
+    </div>
+{% endblock %}

+ 51 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/form_modals.tpl

@@ -0,0 +1,51 @@
+<div class="modal fade" id="send-invitation-modal" tabindex="-1" role="dialog"
+     aria-labelledby="send-invitation-modal-title" aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"
+                        aria-label="{{ 'Close' | get_lang }}">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+                <h4 class="modal-title"
+                    id="send-invitation-modal-title">{{ 'SendInvitation' | get_lang }}</h4>
+            </div>
+            <div class="modal-body">
+                <div id="send-invitation-alert"></div>
+                {{ invitation_form }}
+            </div>
+            <div class="modal-footer">
+                <button type="button" id="btn-send-invitation"
+                        class="btn btn-primary">
+                    <em class="fa fa-send"></em> {{ 'Send' | get_lang }}
+                </button>
+            </div>
+        </div>
+    </div>
+</div>
+
+<script>
+    $(document).on('ready', function () {
+        var $sendInvitationModal = $('#send-invitation-modal');
+        var sendToUser = 0;
+
+        $('.btn-to-send-invitation').on('click', function (e) {
+            e.preventDefault();
+            sendToUser = $(this).data('send-to');
+            $sendInvitationModal.modal('show');
+        });
+
+        $('#btn-send-invitation').on('click', function (e) {
+            e.preventDefault();
+
+            var $frmSendInvitation = $sendInvitationModal.find('.modal-body form'),
+                    url = '{{ _p.web_ajax }}message.ajax.php?a=send_invitation&user_id=' + sendToUser;
+
+            $.get(url, $frmSendInvitation.serialize(), function () {
+                $frmSendInvitation[0].reset();
+
+                window.location.reload();
+            });
+        });
+    });
+</script>

+ 29 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/friends.tpl

@@ -0,0 +1,29 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            <div class="social-network-menu">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div id="wallMessages" class="col-md-9" style="min-height:1px">
+            <div class="row">
+                <div class="col-md-12">
+                    <div id="message_ajax_reponse" class=""></div>
+                </div>
+            </div>
+            <div class="row">
+                {{ social_right_content }}
+            </div>
+            <div id="display_response_id" class="span5"></div>
+            {{ social_auto_extend_link }}
+        </div>
+        <div class="col-md-4">
+            <div class="row">
+                {{ social_right_information }}
+            </div>
+        </div>
+    </div>
+{% endblock %}

+ 1 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/group_block.tpl

@@ -0,0 +1 @@
+{{ social_avatar_block }}

+ 32 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/group_view.tpl

@@ -0,0 +1,32 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row" xmlns="http://www.w3.org/1999/html">
+        <div class="col-md-3">
+            <div class="sm-groups">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div class="col-md-9">
+            {{ create_link }}
+            {% if is_group_member == false %}
+                <div class="social-group-details-info">
+                    {{ 'Privacy' | get_lang }}
+
+                    {% if group_info.visibility == 1 %}
+                        {{ 'ThisIsAnOpenGroup' | get_lang }}
+                    {% else %}
+                        {{ 'ThisIsACloseGroup' | get_lang }}
+                    {% endif %}
+                </div>
+            {% endif %}
+
+            {{ social_right_content }}
+
+            <div id="display_response_id" class="col-md-5"></div>
+            {{ social_auto_extend_link }}
+        </div>
+
+    </div>
+{% endblock %}

+ 45 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/group_waiting_list.tpl

@@ -0,0 +1,45 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            <div class="social-network-menu">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div id="wallMessages" class="col-md-9" style="min-height:1px">
+            <div class="row">
+                <div class="col-md-12">
+                    <div id="message_ajax_reponse" class=""></div>
+                </div>
+            </div>
+            <div class="row">
+                {{ social_right_content }}
+
+                {% for member in members %}
+                    <div class="col-md-4">
+                        <div class="card">
+                            <div class="avatar">
+                                {{ member.image }}
+                            </div>
+                            <div class="content">
+                                {{ member.user_info.complete_name }}
+                                {{ member.link }}
+                            </div>
+                        </div>
+                    </div>
+
+                {% endfor %}
+
+            </div>
+            <div id="display_response_id" class="col-md-5"></div>
+            {{ social_auto_extend_link }}
+        </div>
+        <div class="col-md-4">
+            <div class="row">
+                {{ social_right_information }}
+            </div>
+        </div>
+    </div>
+{% endblock %}

+ 15 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/groups.tpl

@@ -0,0 +1,15 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            <div class="social-network-menu">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div class="col-md-9">
+            {{ social_right_content }}
+        </div>
+    </div>
+{% endblock %}

+ 84 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/home.html.twig

@@ -0,0 +1,84 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            {{ social_avatar_block }}
+
+            <div class="social-network-menu">
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div class="col-md-6">
+            {{ social_search_block }}
+            {{ social_skill_block }}
+            {{ social_group_block }}
+            {{ social_right_content }}
+            <div id="message_ajax_reponse" class=""></div>
+            <div id="display_response_id"></div>
+            {{ social_auto_extend_link }}
+        </div>
+        <div class="col-md-3">
+            <!-- Block chat list -->
+            <div class="chat-friends">
+                <div class="panel-group" id="blocklistFriends" role="tablist"
+                     aria-multiselectable="true">
+                    <div class="panel panel-default">
+                        <div class="panel-heading" role="tab" id="headingOne">
+                            <h4 class="panel-title">
+                                <a role="button" data-toggle="collapse"
+                                   data-parent="#blocklistFriends"
+                                   href="#listFriends" aria-expanded="true"
+                                   aria-controls="listFriends">
+                                    {{ "SocialFriend" | get_lang }}
+                                </a>
+                            </h4>
+                        </div>
+                        <div id="listFriends" class="panel-collapse collapse in"
+                             role="tabpanel" aria-labelledby="headingOne">
+                            <div class="panel-body">
+                                {{ social_friend_block }}
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+
+            <!-- Block session list -->
+            {% if sessionList != null %}
+                <div class="panel-group" id="session-block" role="tablist"
+                     aria-multiselectable="true">
+                    <div class="panel panel-default">
+                        <div class="panel-heading" role="tab" id="headingOne">
+                            <h4 class="panel-title">
+                                <a role="button" data-toggle="collapse"
+                                   data-parent="#session-block"
+                                   href="#sessionList" aria-expanded="true"
+                                   aria-controls="sessionList">
+                                    {{ "MySessions" | get_lang }}
+                                </a>
+                            </h4>
+                        </div>
+                        <div id="sessionList" class="panel-collapse collapse in"
+                             role="tabpanel" aria-labelledby="headingOne">
+                            <div class="panel-body">
+                                <ul class="list-group">
+                                    {% for session in sessionList %}
+                                        <li id="session_{{ session.id }}"
+                                            class="list-group-item"
+                                            style="min-height:65px;">
+                                            <img class="img-session"
+                                                 src="{{ session.image }}"/>
+                                            <span class="title">{{ session.name }}</span>
+                                        </li>
+                                    {% endfor %}
+                                </ul>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            {% endif %}
+
+        </div>
+    </div>
+{% endblock %}

+ 15 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/inbox.tpl

@@ -0,0 +1,15 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            <div class="social-network-menu">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div class="col-md-9">
+            {{ social_right_content }}
+        </div>
+    </div>
+{% endblock %}

+ 15 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/invitations.tpl

@@ -0,0 +1,15 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            <div class="social-network-menu">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div class="col-md-9">
+            {{ social_invitations_block }}
+        </div>
+    </div>
+{% endblock %}

+ 24 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/myfiles.tpl

@@ -0,0 +1,24 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            <div class="social-network-menu">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div id="wallMessages" class="col-md-9" style="min-height:1px">
+            <div class="row">
+                <div class="col-md-12">
+                    <div id="message_ajax_reponse" class=""></div>
+                </div>
+            </div>
+            <div class="row">
+                {{ social_right_content }}
+            </div>
+            <div id="display_response_id" class="col-md-12"></div>
+            {{ social_auto_extend_link }}
+        </div>
+    </div>
+{% endblock %}

+ 121 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/profile.tpl

@@ -0,0 +1,121 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            {{ social_avatar_block }}
+            {{ social_extra_info_block }}
+            <div class="social-network-menu">
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div id="wallMessages" class="col-md-6">
+            {{ social_wall_block }}
+            <div class="spinner"></div>
+            <div class="panel panel-preview panel-default" hidden="true">
+                <div class="panel-heading">
+                    <h3 class="panel-title">{{ "Url" | get_lang }}
+                        - {{ "Preview" | get_lang }}</h3>
+                </div>
+                <div class="panel-body">
+                    <div class="url_preview"></div>
+                </div>
+            </div>
+            {{ social_post_wall_block }}
+            {{ social_auto_extend_link }}
+        </div>
+        <div class="col-md-3">
+            <div class="chat-friends">
+                <div class="panel-group" id="blocklistFriends" role="tablist"
+                     aria-multiselectable="true">
+                    <div class="panel panel-default">
+                        <div class="panel-heading" role="tab" id="headingOne">
+                            <h4 class="panel-title">
+                                <a role="button" data-toggle="collapse"
+                                   data-parent="#blocklistFriends"
+                                   href="#listFriends" aria-expanded="true"
+                                   aria-controls="listFriends">
+                                    {{ "SocialFriend" | get_lang }}
+                                </a>
+                            </h4>
+                        </div>
+                        <div id="listFriends" class="panel-collapse collapse in"
+                             role="tabpanel" aria-labelledby="headingOne">
+                            <div class="panel-body">
+                                {{ social_friend_block }}
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            {{ social_skill_block }}
+            {{ social_group_info_block }}
+            <!-- Block course list -->
+            {% if social_course_block != null %}
+                <div class="panel-group" id="course-block" role="tablist"
+                     aria-multiselectable="true">
+                    <div class="panel panel-default">
+                        <div class="panel-heading" role="tab" id="headingOne">
+                            <h4 class="panel-title">
+                                <a role="button" data-toggle="collapse"
+                                   data-parent="#course-block"
+                                   href="#courseList" aria-expanded="true"
+                                   aria-controls="courseList">
+                                    {{ "MyCourses" | get_lang }}
+                                </a>
+                            </h4>
+                        </div>
+                        <div id="courseList" class="panel-collapse collapse in"
+                             role="tabpanel" aria-labelledby="headingOne">
+                            <div class="panel-body">
+                                <ul class="list-group">
+                                    {{ social_course_block }}
+                                </ul>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            {% endif %}
+            <!-- Block session list -->
+            {% if sessionList != null %}
+                <div class="panel-group" id="session-block" role="tablist"
+                     aria-multiselectable="true">
+                    <div class="panel panel-default">
+                        <div class="panel-heading" role="tab" id="headingOne">
+                            <h4 class="panel-title">
+                                <a role="button" data-toggle="collapse"
+                                   data-parent="#session-block"
+                                   href="#sessionList" aria-expanded="true"
+                                   aria-controls="sessionList">
+                                    {{ "MySessions" | get_lang }}
+                                </a>
+                            </h4>
+                        </div>
+                        <div id="sessionList" class="panel-collapse collapse in"
+                             role="tabpanel" aria-labelledby="headingOne">
+                            <div class="panel-body">
+                                <ul class="list-group">
+                                    {% for session in sessionList %}
+                                        <li id="session_{{ session.id }}"
+                                            class="list-group-item"
+                                            style="min-height:65px;">
+                                            <img class="img-session"
+                                                 src="{{ session.image }}"/>
+                                            <span class="title">{{ session.name }}</span>
+                                        </li>
+                                    {% endfor %}
+                                </ul>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            {% endif %}
+
+            {{ social_rss_block }}
+            {{ social_right_information }}
+        </div>
+    </div>
+    {% if form_modals is defined %}
+        {{ form_modals }}
+    {% endif %}
+{% endblock %}

+ 26 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/search.tpl

@@ -0,0 +1,26 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-3">
+            <div class="social-network-menu">
+                {{ social_avatar_block }}
+                {{ social_menu_block }}
+            </div>
+        </div>
+        <div class="col-md-9">
+
+            <div class="form-search-sm">
+                {{ search_form }}
+            </div>
+            <div class="list-search-sm">
+                {{ social_search }}
+            </div>
+
+        </div>
+    </div>
+
+    {% if form_modals is defined %}
+        {{ form_modals }}
+    {% endif %}
+{% endblock %}

+ 69 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/skills_block.tpl

@@ -0,0 +1,69 @@
+<div class="panel-group" id="skill-block" role="tablist"
+     aria-multiselectable="true">
+    <div class="panel panel-default">
+        <div class="panel-heading" role="tab" id="headingOne">
+            <h4 class="panel-title">
+                <a role="button" data-toggle="collapse"
+                   data-parent="#skill-block" href="#skillList"
+                   aria-expanded="true" aria-controls="skillList">
+                    {{ "Skills" | get_lang }}
+                </a>
+
+                <div class="btn-group pull-right">
+                    <a class="btn btn-xs btn-default dropdown-toggle"
+                       data-toggle="dropdown" href="#">
+                        <span class="caret"></span>
+                    </a>
+                    <ul class="dropdown-menu">
+                        {% if show_skills_report_link %}
+                            <li>
+                                <a href="{{ _p.web_main ~ 'social/my_skills_report.php' }}"> {{ 'SkillsReport'|get_lang }}</a>
+                            </li>
+                        {% endif %}
+
+                        <li>
+                            <a href="{{ _p.web_main ~ 'social/skills_wheel.php' }}"> {{ 'SkillsWheel'|get_lang }}</a>
+                        </li>
+                        <li>
+                            <a href="{{ _p.web_main ~ 'social/skills_ranking.php' }}"> {{ 'YourSkillRankingX'|get_lang|format(ranking) }}</a>
+                        </li>
+                    </ul>
+                </div>
+            </h4>
+        </div>
+        <div id="skillList" class="panel-collapse collapse in" role="tabpanel"
+             aria-labelledby="headingOne">
+            <div class="panel-body">
+                {% if skills %}
+                    <figure class="list-badges">
+                        {% for skill in skills %}
+                            <figure class="thumbnail">
+                                <a href="{{ skill.issue_url }}" target="_blank">
+                                    <img title="{{ skill.name }}"
+                                         class="img-responsive"
+                                         src="{{ skill.icon }}" width="64"
+                                         height="64" alt="{{ skill.name }}">
+                                </a>
+                                <figcaption class="caption text-center">
+                                    <a href="{{ skill.issue_url }}"
+                                       target="_blank">
+                                        {{ skill.name }}
+                                        {% if skill.source_name %}
+                                            <br>
+                                            <small>{{ skill.source_name }}</small>
+                                        {% endif %}
+                                    </a>
+                                </figcaption>
+                            </figure>
+                        {% endfor %}
+                    </figure>
+                {% else %}
+                    <p>{{ 'WithoutAchievedSkills'|get_lang }}</p>
+                    <p>
+                        <a href="{{ _p.web_main ~ 'social/skills_wheel.php' }}">{{ 'SkillsWheel'|get_lang }}</a>
+                    </p>
+                {% endif %}
+            </div>
+        </div>
+    </div>
+</div>

+ 79 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/user_block.tpl

@@ -0,0 +1,79 @@
+<div class="sidebar-avatar">
+    <div class="panel-group" id="sn-avatar" role="tablist"
+         aria-multiselectable="true">
+        <div class="panel panel-default">
+            <div class="panel-heading" role="tab" id="heading-sn">
+                <h4 class="panel-title">
+                    <a role="button" data-toggle="collapse"
+                       data-parent="#sn-avatar" href="#sn-avatar-one"
+                       aria-expanded="true" aria-controls="sn-avatar-one">
+                        {{ "Role" | get_lang }}
+                    </a>
+                </h4>
+            </div>
+            <div id="sn-avatar-one" class="panel-collapse collapse in"
+                 role="tabpanel" aria-labelledby="heading-sn">
+                <div class="panel-body">
+
+                    {{ social_avatar_block }}
+
+                    <ul class="list-user-data">
+                        <li class="item">
+                            {{ user.complete_name }}
+                        </li>
+                        {% if vcard_user_link %}
+                            <li class="item">
+                                <a href="{{ _p.web }}main/messages/new_message.php">
+                                    <img src="{{ "instant_message.png" | icon }}"
+                                         alt="{{ "Email" | get_lang }}">
+                                    {{ user.email }}
+                                </a>
+                            </li>
+                            <li class="item">
+                                <a href="{{ vcard_user_link }}">
+                                    <img src="{{ "vcard.png" | icon(16) }}"
+                                         alt="{{ "BusinessCard" | get_lang }}"
+                                         width="16" height="16">
+                                    {{ "BusinessCard" | get_lang }}
+                                </a>
+                            </li>
+                        {% endif %}
+                        {% if chat_enabled == 1 %}
+                            <li class="item">
+                                {% if user.id == _u.id %}
+                                    <img src="{{ "online.png" | icon }}"
+                                         alt="{{ "Online" | get_lang }}">
+                                    {{ "Chat" | get_lang }} ({{ "Online" | get_lang }})
+                                {% elseif user.user_is_online_in_chat != 0 %}
+                                    <a onclick="javascript:chatWith('{{ user.id }}', '{{ user.complete_name }}', '{{ user.user_is_online }}','{{ user.avatar_small }}')"
+                                       href="javascript:void(0);">
+                                        <img src="{{ "online.png" | icon }}"
+                                             alt="{{ "Online" | get_lang }}">
+                                        {{ "Chat" | get_lang }}
+                                        ({{ "Online" | get_lang }})
+                                    </a>
+                                {% else %}
+                                    <img src="{{ "offline.png" | icon }}"
+                                         alt="{{ "Online" | get_lang }}">
+                                    {{ "Chat" | get_lang }} ({{ "Offline" | get_lang }})
+                                {% endif %}
+                            </li>
+                        {% endif %}
+
+                        {% if not profile_edition_link is empty %}
+                            <li class="item">
+                                <a class="btn link btn-sm btn-block"
+                                   href="{{ profile_edition_link }}">
+                                    <em class="fa fa-edit"></em>{{ "EditProfile" | get_lang }}
+                                </a>
+                            </li>
+                        {% endif %}
+
+                    </ul>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+

+ 21 - 0
src/Chamilo/CoreBundle/Resources/views/default/social/whoisonline.tpl

@@ -0,0 +1,21 @@
+{% extends template ~ "/layout/layout_1_col.tpl" %}
+
+{% block content %}
+    <div class="row">
+        <div class="col-md-12">
+            <div class="search-user">
+                <div class="panel panel-default">
+                    <div class="panel-heading">
+                        {{ 'SearchUsers' | get_lang }}
+                    </div>
+                    <div class="panel-body">
+                        {{ social_search }}
+                    </div>
+                </div>
+            </div>
+            <div id="whoisonline">
+                {{ whoisonline }}
+            </div>
+        </div>
+    </div>
+{% endblock %}

+ 4 - 3
src/Chamilo/CoreBundle/Settings/LanguageSettingsSchema.php

@@ -21,7 +21,7 @@ class LanguageSettingsSchema implements SchemaInterface
         $builder
             ->setDefaults(
                 array(
-                    'platform_language' => '',
+                    'platform_language' => 'en',
                     'allow_use_sub_language' => '',
                     'auto_detect_language_custom_pages' => '',
                     'show_different_course_language' => '',
@@ -51,13 +51,14 @@ class LanguageSettingsSchema implements SchemaInterface
     public function buildForm(FormBuilderInterface $builder)
     {
         $builder
-            ->add('platform_language')
+            ->add('platform_language', 'language')
             ->add('allow_use_sub_language', 'yes_no')
             ->add('auto_detect_language_custom_pages', 'yes_no')
             ->add('show_different_course_language', 'yes_no')
             ->add('language_priority_1')
             ->add('language_priority_2')
             ->add('language_priority_3')
-            ->add('language_priority_4');
+            ->add('language_priority_4')
+        ;
     }
 }

+ 2 - 2
src/Chamilo/CoreBundle/Settings/MessageSettingsSchema.php

@@ -21,8 +21,8 @@ class MessageSettingsSchema implements SchemaInterface
         $builder
             ->setDefaults(
                 array(
-                    'allow_message_tool' => '',
-                    'allow_send_message_to_all_platform_users' => '',
+                    'allow_message_tool' => 'true',
+                    'allow_send_message_to_all_platform_users' => 'false',
                     'message_max_upload_filesize' => '20971520',
 
                 )

+ 3 - 0
src/Chamilo/CoreBundle/Settings/SessionSettingsSchema.php

@@ -35,6 +35,7 @@ class SessionSettingsSchema implements SchemaInterface
                     'prevent_session_admins_to_manage_all_users' => '',
                     'session_course_ordering' => '',
                     'limit_session_admin_role' => '',
+                    'allow_tutors_to_assign_students_to_session' => '',
                 )
             )
             ->setAllowedTypes(
@@ -64,6 +65,8 @@ class SessionSettingsSchema implements SchemaInterface
             ->add('prevent_session_admins_to_manage_all_users', 'yes_no')
             ->add('session_course_ordering')
             ->add('limit_session_admin_role', 'yes_no')
+            ->add('allow_tutors_to_assign_students_to_session', 'yes_no')
+
 
         ;
     }

+ 1 - 1
src/Chamilo/CoreBundle/Settings/SocialSettingsSchema.php

@@ -21,7 +21,7 @@ class SocialSettingsSchema implements SchemaInterface
         $builder
             ->setDefaults(
                 array(
-                    'allow_social_tool' => '',
+                    'allow_social_tool' => 'true',
                     'allow_students_to_create_groups_in_social' => '',
 
                 )

+ 4 - 1
src/Chamilo/CourseBundle/Controller/Home/HomeController.php

@@ -45,6 +45,7 @@ class HomeController extends ToolBaseController
         $courseCode = $course->getId();
         $sessionId = api_get_session_id();
         $sessionHandler = $request->getSession();
+
         $coursesAlreadyVisited = $sessionHandler->get('coursesAlreadyVisited');
 
         $result = $this->autoLaunch();
@@ -98,13 +99,15 @@ class HomeController extends ToolBaseController
         $sessionHandler->remove('toolgroup');
         $sessionHandler->remove('_gid');
 
+        //is_courseMember
+
         $isSpecialCourse = \CourseManager::isSpecialCourse($courseCode);
 
         if ($isSpecialCourse) {
             $user = $this->getUser();
             if (!empty($user)) {
                 $userId = $this->getUser()->getId();
-                $autoreg = $this->getRequest()->get('autoreg');
+                $autoreg = $request->get('autoreg');
                 if ($autoreg == 1) {
                     \CourseManager::subscribe_user(
                         $userId,