]> git.mjollnir.org Git - moodle.git/commitdiff
Adding some missing log actions when restoring forums. MDL-13184 ; merged from 19_STABLE
authorstronk7 <stronk7>
Sun, 27 Jan 2008 00:39:56 +0000 (00:39 +0000)
committerstronk7 <stronk7>
Sun, 27 Jan 2008 00:39:56 +0000 (00:39 +0000)
mod/forum/restorelib.php

index 13f0bb5e5e12da319435bbfa6feb24df7d1e216b..c0861bbe7cea9978a34072b034cfcfb9f91ea6c0 100644 (file)
                 }
             }
             break;
+        case "stop tracking":
+            if ($log->cmid) {
+                //Get the new_id of the module (to recode the url and info fields)
+                $mod = backup_getid($restore->backup_unique_code,$log->module,$log->info);
+                if ($mod) {
+                    $log->url = "view.php?f=".$mod->new_id;
+                    $log->info = $mod->new_id;
+                    $status = true;
+                }
+            }
+            break;
         case "update":
             if ($log->cmid) {
                 //Get the new_id of the module (to recode the info field)
             $log->url = "index.php?id=".$log->course;
             $status = true;
             break;
+        case "subscribeall":
+            $log->url = "index.php?id=".$log->course;
+            $status = true;
+            break;
+        case "unsubscribeall":
+            $log->url = "index.php?id=".$log->course;
+            $status = true;
+            break;
         case "subscribe":
             if ($log->cmid) {
                 //Get the new_id of the module (to recode the info and url field)
             }
             break;
         case "view subscriber":
+        case "view subscribers":
             if ($log->cmid) {
                 //Get the new_id of the module (to recode the info and field)
                 $mod = backup_getid($restore->backup_unique_code,$log->module,$log->info);
             }
             break;
         case "delete discussi":
+        case "delete discussion":
             if ($log->cmid) {
                 //Get the new_id of the module (to recode the info field)
                 $mod = backup_getid($restore->backup_unique_code,$log->module,$log->info);
                 }
             }
             break;
+        case "user report":
+            //Extract mode from url
+            $mode = substr(strrchr($log->url,"="),1);
+            //Get new user id
+            if ($use = backup_getid($restore->backup_unique_code, 'user', $log->info)) {
+                $log->url = 'user.php?id=' . $log->course . '&user=' . $use->new_id . '&mode=' . $mode;
+                $log->info = $use->new_id;
+                $status = true;
+            }
+            break;
         case "search":
             $log->url = "search.php?id=".$log->course."&search=".urlencode($log->info);
             $status = true;