فهرست منبع

add the possibility to see the last advance and the next advance in the post it BT#937

Carlos Vargas 15 سال پیش
والد
کامیت
5ac4c95538
3فایلهای تغییر یافته به همراه25 افزوده شده و 5 حذف شده
  1. 1 0
      main/course_info/infocours.php
  2. 23 4
      main/inc/introductionSection.inc.php
  3. 1 1
      main/inc/lib/thematic.lib.php

+ 1 - 0
main/course_info/infocours.php

@@ -240,6 +240,7 @@ if (is_settings_editable()) {
 $form->addElement('html', '<div class="sectiontitle" style="margin-top: 40px;"><a href="#header" style="float:right;">'.Display::return_icon('top.gif', get_lang('Top')).'</a><a name="chatsettings" id="chatsettings"></a>'.Display::return_icon('attendance.gif', get_lang('ConfigChat')).' '.get_lang('ThematicAdvanceConfiguration').'</div>');
 $form->addElement('radio', 'display_info_advance_inside_homecourse', get_lang('InfoAboutAdvanceInsideHomeCourse'), get_lang('DisplayAboutLastDoneAdvance'), 1);
 $form->addElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DisplayAboutNextAdvanceNotDone'), 2);
+$form->addElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DisplayAboutNextAdvanceNotDoneAndLastDoneAdvance'), 3);
 $form->addElement('radio', 'display_info_advance_inside_homecourse', null, get_lang('DoNotDisplayAnyAdvance'), 0);
 
 

+ 23 - 4
main/inc/introductionSection.inc.php

@@ -168,8 +168,14 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
 		$information_title = get_lang('InfoAboutNextAdvanceNotDone');
 		$next_advance_not_done = $thematic->get_next_thematic_advance_not_done();
 		$thematic_advance_info = $thematic->get_thematic_advance_list($next_advance_not_done);
+	} else if(api_get_course_setting('display_info_advance_inside_homecourse') == '3') {
+		$information_title = get_lang('InfoAboutLastDoneAdvanceAndNextAdvanceNotDone');
+		$last_done_advance =  $thematic->get_last_done_thematic_advance();
+		$next_advance_not_done = $thematic->get_next_thematic_advance_not_done();
+		$thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
+		$thematic_advance_info2 = $thematic->get_thematic_advance_list($next_advance_not_done);
 	}
-		
+
 	if (!empty($thematic_advance_info)) {
 
 		$style_introduction_section = 'style="width:60%;float:left;margin-left:6%;"';
@@ -178,6 +184,7 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
 			$thematic_advance = '<a href="'.api_get_path(WEB_CODE_PATH).'course_progress/index.php?action=thematic_details&'.api_get_cidreq().'">'.get_lang('ThematicAdvance').'&nbsp;'.$thematic->get_total_average_of_thematic_advances().'%</a>';
 		}		
 		$thematic_info = $thematic->get_thematic_list($thematic_advance_info['thematic_id']);
+		
 		$thematic_advance_info['start_date'] = api_get_local_time($thematic_advance_info['start_date']);
 		$thematic_advance_info['start_date'] = api_format_date($thematic_advance_info['start_date'], DATE_TIME_FORMAT_LONG);
 		
@@ -185,16 +192,28 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
 								  <div class="thematic-postit-top"><a class="thematic-postit-head" style="" href="#">'.Display::return_icon('postit_top.png').'</a></div>
 								  <div class="thematic-postit-center">'; 								
 		$thematic_description_html .= '<h3>'.$thematic_advance.'</h3>';	
-		$thematic_description_html .= '<h4>'.$information_title.'</h4>';						  								
 		$thematic_description_html .= '<div><strong>'.$thematic_info['title'].'</strong></div>';			
 		$thematic_description_html .= '<div style="font-size:8pt;"><strong>'.$thematic_advance_info['start_date'].'</strong></div>';
 		$thematic_description_html .= '<div>'.$thematic_advance_info['content'].'</div>';
 		$thematic_description_html .= '<div>'.get_lang('DurationInHours').' : '.$thematic_advance_info['duration'].'</div>';
-		$thematic_description_html .= '<br />';								  	
+		$thematic_description_html .= '<br />';
+		if (!empty($thematic_advance_info2)){
+			$thematic_info2 = $thematic->get_thematic_list($thematic_advance_info2['thematic_id']);
+		
+			$thematic_advance_info2['start_date'] = api_get_local_time($thematic_advance_info2['start_date']);
+			$thematic_advance_info2['start_date'] = api_format_date($thematic_advance_info2['start_date'], DATE_TIME_FORMAT_LONG);
+														  								
+			$thematic_description_html .= '<div><strong>'.$thematic_info2['title'].'</strong></div>';			
+			$thematic_description_html .= '<div style="font-size:8pt;"><strong>'.$thematic_advance_info2['start_date'].'</strong></div>';
+			$thematic_description_html .= '<div>'.$thematic_advance_info2['content'].'</div>';
+			$thematic_description_html .= '<div>'.get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].'</div>';
+			$thematic_description_html .= '<br />';								  	
+		}								  	
 		$thematic_description_html .= '</div>
 								  <div  class="thematic-postit-bottom">'.Display::return_icon('postit_bottom.png').'</div>
 								  </div></div>';
-	}
+
+	} 
 }
 
 echo '<div '.$style_introduction_section.'>';

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

@@ -388,7 +388,6 @@ class Thematic
 	 * @return	array	data
 	 */
 	 public function get_thematic_advance_list($thematic_advance_id = null, $course_code = null) {	 	
-	 	
 	 	// set current course
 	 	if (isset($course_code)) {
 	 		$course_info = api_get_course_info($course_code);
@@ -421,6 +420,7 @@ class Thematic
 				}
 			}										
 		}
+		
 		return $data;
 	 }