Browse Source

Fixed condition about LP visibility (closes BT#1618)

ywarnier 14 years ago
parent
commit
5c58697d49
2 changed files with 2 additions and 3 deletions
  1. 1 2
      main/newscorm/learnpath.class.php
  2. 1 1
      main/newscorm/lp_list.php

+ 1 - 2
main/newscorm/learnpath.class.php

@@ -1999,11 +1999,10 @@ class learnpath {
             // Also check the time availability of the learning path
             if ($is_visible) {
                 $now = str_replace($find,'',api_get_local_time());
-            	if ($now<$from or $now>$to) {
+            	if ((($row['publicated_on']!='0000-00-00 00:00:00') && ($now<$from)) or (($row['expired_on']!='0000-00-00 00:00:00') && ($now>$to))) {
             		$is_visible = false;
             	}
             }
-    
             return $is_visible;
         }
         return false;

+ 1 - 1
main/newscorm/lp_list.php

@@ -271,7 +271,7 @@ if (is_array($flat_list)) {
             $dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em>  &nbsp;&nbsp; '.$details['lp_proximity'].' &nbsp;&nbsp; '.$details['lp_encoding'].'</td>'."\n";
             */
 
-            $dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em>  &nbsp;&nbsp; '.$details['lp_proximity'].'</td>'."\n";
+            $dsp_desc = '<td valign="middle" style="color: grey; padding-top:1em;"><em>'.$details['lp_maker'].'</em>  &nbsp;&nbsp; '.$details['lp_proximity'].'<br />'.(learnpath::is_lp_visible_for_student($id,api_get_user_id())?'':'('.get_lang('LPNotVisibleToStudent').')').'</td>'."\n";
 
             /* Export */