Browse Source

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

Yannick Warnier 11 years ago
parent
commit
da93e79ac4

+ 1 - 1
main/inc/lib/banner.lib.php

@@ -637,7 +637,7 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) {
         }
 
         if (!empty($lis)) {
-            $html .= Display::tag('ul', $lis, array('class'=>'breadcrumb'));
+            $html .= Display::tag('ul', $lis, array('class'=>'breadcrumb','style'=>'margin-top: 0'));
         }
     }
     return $html ;

+ 28 - 21
main/newscorm/learnpath.class.php

@@ -5085,28 +5085,35 @@ class learnpath
         if ($update_audio == 'true') {
             $return .= '<form action="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;updateaudio=' . Security :: remove_XSS($_GET['updateaudio']) .'&amp;action=' . Security :: remove_XSS($_GET['action']) . '&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" method="post" enctype="multipart/form-data" name="updatemp3" id="updatemp3">';
         }
-        $return .= '<div id="message"></div>';
-
-        $return_audio = '<table class="data_table">';
-        $return_audio .= '<tr>';
-        $return_audio .= '<th width="60%">' . get_lang('Title') . '</th>';
-        $return_audio .= '<th>' . get_lang('Audio') . '</th>';
-   		$return_audio .= '</tr>';
-
-        if ($update_audio != 'true') {
-        	$return .= '<div class="span12">';
-            $return .= self::return_new_tree($update_audio);
-        	$return .='</div>';
-        	$return .= Display::div(Display::url(get_lang('Save'), '#', array('id'=>'listSubmit', 'class'=>'btn')), array('style'=>'float:left; margin-top:15px;width:100%'));
-        } else {
-            $return_audio .= self::return_new_tree($update_audio);
-        	$return .= $return_audio.'</table>';
-        }
+	$return .= '<div id="message"></div>';
+	if(count($this->items) == 0)
+	{
+		$return .= Display::display_normal_message(get_lang('YouShouldAddItemsBeforeAttachAudio'));
+	}
+	else
+	{
+
+		$return_audio = '<table class="data_table">';
+		$return_audio .= '<tr>';
+		$return_audio .= '<th width="60%">' . get_lang('Title') . '</th>';
+		$return_audio .= '<th>' . get_lang('Audio') . '</th>';
+		$return_audio .= '</tr>';
+
+		if ($update_audio != 'true') {
+			$return .= '<div class="span12">';
+			$return .= self::return_new_tree($update_audio);
+			$return .='</div>';
+			$return .= Display::div(Display::url(get_lang('Save'), '#', array('id'=>'listSubmit', 'class'=>'btn')), array('style'=>'float:left; margin-top:15px;width:100%'));
+		} else {
+			$return_audio .= self::return_new_tree($update_audio);
+			$return .= $return_audio.'</table>';
+		}
 
-        // We need to close the form when we are updating the mp3 files.
-        if ($update_audio == 'true') {
-            $return .= '<div style="margin:40px 0; float:right;"><button class="save" type="submit" name="save_audio" id="save_audio">' . get_lang('SaveAudioAndOrganization') . '</button></div>'; // TODO: What kind of language variable is this?
-        }
+		// We need to close the form when we are updating the mp3 files.
+		if ($update_audio == 'true') {
+			$return .= '<div style="margin:40px 0; float:right;"><button class="save" type="submit" name="save_audio" id="save_audio">' . get_lang('SaveAudioAndOrganization') . '</button></div>'; // TODO: What kind of language variable is this?
+		}
+	}
 
         // We need to close the form when we are updating the mp3 files.
         if ($update_audio == 'true' && count($arrLP) != 0) {

+ 6 - 3
main/newscorm/lp_view.php

@@ -424,6 +424,9 @@ if ($is_allowed_to_edit) {
         var hauteurHeader = document.getElementById('header').offsetHeight;
         var hauteurAuthorImg = document.getElementById('author_image').offsetHeight;
         var hauteurAuthorName = document.getElementById('author_name').offsetHeight;
+        var heightBreadcrumb = document.getElementById('learning_path_breadcrumb_zone').offsetHeight;
+        var control = document.getElementById('control');
+        var heightControl = (control)? control.offsetHeight : 0;
 
         var hauteurMedia = 0;
         if ($("#lp_media_file").length != 0) {
@@ -440,7 +443,7 @@ if ($is_allowed_to_edit) {
         <?php if (!empty($_SESSION['oLP']->scorm_debug)) echo 'debugsize = 150;' ?>
         document.getElementById('inner_lp_toc').style.height = innerHauteur - hauteurHaut - 40 - debugsize + "px";
         if (document.getElementById('content_id')) {
-            document.getElementById('content_id').style.height = innerHauteur + 'px';
+            document.getElementById('content_id').style.height = innerHauteur - debugsize - heightBreadcrumb - heightControl + "px";
         }
 
     // Loads the glossary library.
@@ -484,8 +487,8 @@ if ($is_allowed_to_edit) {
             updateContentHeight();
         });
     });
-    //window.onload = updateContentHeight;
-    //window.onresize = updateContentHeight;
+    window.onload = updateContentHeight();
+    window.onresize = updateContentHeight();
 </script>
 <?php
 // Restore a global setting.

+ 8 - 6
main/survey/fillsurvey.php

@@ -44,8 +44,12 @@ $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION)
 
 $table_user = Database :: get_main_table(TABLE_MAIN_USER);
 
-// We initialize test as private (not anonymous):
-$isAnonymous = false;
+// Check if user is anonymous or not
+if (api_is_anonymous($_user['user_id'], true)) {
+    $isAnonymous = true;
+} else {
+    $isAnonymous = false;
+}
 
 // getting all the course information
 if (isset($_GET['course'])) {
@@ -72,9 +76,7 @@ if ($surveyCode != "") {
     } 
 // If is anonymous and it is allowed to take the survey as anonymous, mark survey as anonymous:
 } else {
-    if (api_is_anonymous($_user['user_id'], true)) {
-        $isAnonymous = true;
-    }
+    //nothing to do
 } 
 
 // Header
@@ -134,7 +136,7 @@ if (Database::num_rows($result) < 1) {
 $survey_invitation = Database::fetch_array($result, 'ASSOC');
 
 // Now we check if the user already filled the survey
-if ($survey_invitation['answered'] == 1 && !isset($_GET['user_id'])) {
+if ($isAnonymous && isset($_SESSION['surveyuser']) || ($survey_invitation['answered'] == 1 && !isset($_GET['user_id']))) {
     Display :: display_error_message(get_lang('YouAlreadyFilledThisSurvey'), false);
     Display :: display_footer();
     exit;

+ 1 - 1
main/survey/survey.lib.php

@@ -3105,7 +3105,7 @@ class SurveyUtil {
 				echo '<th>'.$user.'</th>'; // the user column
 			}
 		} else {
-			echo '<th>-</th>';
+			echo '<th>' . get_lang('Anonymous') . '</th>';
 		}
 
 		if ($display_extra_user_fields) {