From 50a611f23ff34a6f4cf177c1d662916993d370c9 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 19 Sep 2007 23:11:29 +0200 Subject: [PATCH] [svn r13100] Added call to api_item_property_update() to insert the learnpaths in item_property --- main/newscorm/aicc.class.php | 1 + main/newscorm/learnpath.class.php | 3 +++ main/newscorm/scorm.class.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/main/newscorm/aicc.class.php b/main/newscorm/aicc.class.php index b7441c3344..47e9a322c6 100644 --- a/main/newscorm/aicc.class.php +++ b/main/newscorm/aicc.class.php @@ -252,6 +252,7 @@ class aicc extends learnpath { $res = api_sql_query($sql); $lp_id = Database::get_last_insert_id(); $this->lp_id = $lp_id; + api_item_property_update(api_get_course_info($course_code),TOOL_LEARNPATH,$this->lp_id,'LearnpathAdded',api_get_user_id()); $previous = 0; foreach($this->aulist as $identifier => $dummy) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 7ebab30c52..6a5d6c153b 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -602,6 +602,8 @@ class learnpath { $res_insert = api_sql_query($sql_insert); $id = Database::get_last_insert_id(); if($id>0){ + //insert into item_property + api_item_property_update(api_get_course_info($course),TOOL_LEARNPATH,$id,'LearnpathAdded',api_get_user_id()); return $id; } break; @@ -784,6 +786,7 @@ class learnpath { $sql_del_lp = "DELETE FROM $lp WHERE id = ".$this->lp_id; //if($this->debug>2){error_log('New LP - Deleting lp '.$this->lp_id.': '.$sql_del_lp,0);} $res_del_lp = api_sql_query($sql_del_lp); + api_item_property_update(api_get_course_info(),TOOL_LEARNPATH,$this->lp_id,'delete',api_get_user_id()); //TODO: also delete items and item-views } diff --git a/main/newscorm/scorm.class.php b/main/newscorm/scorm.class.php index 16993cbe13..345a15af89 100644 --- a/main/newscorm/scorm.class.php +++ b/main/newscorm/scorm.class.php @@ -384,6 +384,8 @@ class scorm extends learnpath { $res = api_sql_query($sql,__FILE__,__LINE__); $lp_id = Database::get_last_insert_id(); $this->lp_id = $lp_id; + //insert into item_property + api_item_property_update(api_get_course_info($course_code),TOOL_LEARNPATH,$this->lp_id,'LearnpathAdded',api_get_user_id()); //now insert all elements from inside that learning path //make sure we also get the href and sco/asset from the resources