diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 22fbefd849..0ef44f71fc 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -3358,14 +3358,16 @@ class learnpath { $tbl_tool = Database::get_course_table(TOOL_LIST_TABLE); - $sql="SELECT * FROM $tbl_tool where name='$name' and image='scormbuilder.gif'"; + $link = 'newscorm/lp_controller.php?mode=view&lp_id='.$lp_id; + + $sql="SELECT * FROM $tbl_tool where name='$name' and image='scormbuilder.gif' and link LIKE '$link%'"; $result=api_sql_query($sql,__FILE__,__LINE__); $num=Database::num_rows($result); $row2=Database::fetch_array($result); - + //if($this->debug>2){error_log('New LP - '.$sql.' - '.$num,0);} if(($set_visibility == 'i') && ($num>0)) @@ -3378,7 +3380,7 @@ class learnpath { { - $sql ="DELETE FROM $tbl_tool WHERE (name='$name' and image='scormbuilder.gif')"; + $sql ="DELETE FROM $tbl_tool WHERE (name='$name' and image='scormbuilder.gif' and link LIKE '$link%')"; } @@ -3386,7 +3388,7 @@ class learnpath { { - $sql ="UPDATE $tbl_tool set visibility=1 WHERE (name='$name' and image='scormbuilder.gif')"; + $sql ="UPDATE $tbl_tool set visibility=1 WHERE (name='$name' and image='scormbuilder.gif' and link LIKE '$link%')"; } diff --git a/main/newscorm/learnpathList.class.php b/main/newscorm/learnpathList.class.php index 8808e495be..fe683d776c 100644 --- a/main/newscorm/learnpathList.class.php +++ b/main/newscorm/learnpathList.class.php @@ -45,7 +45,8 @@ class learnpathList { //it prevents ' to be slashed and the input (done by learnpath.class.php::toggle_visibility()) //is done using domesticate() $myname = domesticate($row['name']); - $sql2="SELECT * FROM $tbl_tool where (name='$myname' and image='scormbuilder.gif')"; + $mylink = 'newscorm/lp_controller.php?mode=view&lp_id='.$row['id']; + $sql2="SELECT * FROM $tbl_tool where (name='$myname' and image='scormbuilder.gif' and link LIKE '$mylink%')"; //error_log('New LP - learnpathList::learnpathList - getting visibility - '.$sql2,0); $res2 = api_sql_query($sql2,__FILE__,__LINE__); if(Database::num_rows($res2)>0){