示例#1
0
 /**
  * Import record
  *
  * @param
  * @return
  */
 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 {
     switch ($a_entity) {
         case "user_notes":
             $usr_id = $a_mapping->getMapping("Services/User", "usr", $a_rec["Author"]);
             if ($usr_id > 0) {
                 include_once "./Services/Notes/classes/class.ilNote.php";
                 // only import real user (assigned to personal desktop) notes
                 // here.
                 if ((int) $a_rec["RepObjId"] == 0 && $a_rec["ObjId"] == $a_rec["Author"] && $a_rec["Type"] == IL_NOTE_PRIVATE && $a_rec["ObjType"] == "pd") {
                     $note = new ilNote();
                     $note->setObject("pd", 0, $usr_id);
                     $note->setType(IL_NOTE_PRIVATE);
                     $note->setAuthor($usr_id);
                     $note->setText($a_rec["NoteText"]);
                     $note->setSubject($a_rec["Subject"]);
                     $note->setCreationDate($a_rec["CreationDate"]);
                     $note->setLabel($a_rec["Label"]);
                     $note->create(true);
                 }
             }
             break;
     }
 }