24 include_once (
"Services/Notes/classes/class.ilNote.php");
 
   48         function ilNoteGUI($a_rep_obj_id = 
"", $a_obj_id = 
"", $a_obj_type = 
"", $a_include_subobjects = 
false)
 
   52                 $lng->loadLanguageModule(
"notes");
 
   54                 $this->rep_obj_id = $a_rep_obj_id;
 
   55                 $this->obj_id = $a_obj_id;
 
   56                 $this->obj_type = $a_obj_type;
 
   57                 $this->inc_sub = $a_include_subobjects;
 
   62                 $this->anchor_jump = 
true;
 
   63                 $this->add_note_form = 
false;
 
   64                 $this->edit_note_form = 
false;
 
   65                 $this->private_enabled = 
false;
 
   67                 $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
 
   68                 if ($notes_settings->get(
"activate_".$id))
 
   70                         $this->public_enabled = 
true;
 
   74                         $this->public_enabled = 
false;
 
   76                 $this->enable_hiding = 
true;
 
   77                 $this->targets_enabled = 
false;
 
   78                 $this->multi_selection = 
false;
 
   79                 $this->export_html = 
false;
 
   81                 $this->comments_settings = 
false;
 
   83                 $this->note_img = array(
 
   86                                 "alt" => $lng->txt(
"note")),
 
   89                                 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"important")),
 
   92                                 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"question")),
 
   95                                 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"pro")),
 
   98                                 "alt" => $lng->txt(
"note").
", ".$lng->txt(
"contra"))
 
  101                 $this->comment_img = array(
 
  104                                 "alt" => $lng->txt(
"notes_comment")),
 
  107                                 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"important")),
 
  110                                 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"question")),
 
  113                                 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"pro")),
 
  116                                 "alt" => $lng->txt(
"notes_comment").
", ".$lng->txt(
"contra"))
 
  125                 $cmd = $this->ctrl->getCmd(
"getNotesHTML");
 
  126                 $next_class = $this->ctrl->getNextClass($this);
 
  131                                 return $this->
$cmd();
 
  141                 $this->private_enabled = $a_enable;
 
  149                 $this->public_enabled =  $a_enable;
 
  157                 $this->comments_settings = $a_enable;
 
  165                 $this->public_deletion_enabled =  $a_enable;
 
  173                 $this->enable_hiding = $a_enable;
 
  181                 $this->targets_enabled = $a_enable;
 
  189                 $this->multi_selection = $a_enable;
 
  197                 $this->anchor_jump = $a_enable;
 
  207                 $lng->loadLanguageModule(
"notes");
 
  209                 $ntpl = 
new ilTemplate(
"tpl.notes_and_comments.html", 
true, 
true,
 
  213                 $hide_notes = $hide_comments = 
false;
 
  214                 switch($ilCtrl->getCmd())
 
  222                                         $hide_comments = 
true;
 
  232                 if ($this->private_enabled && ($ilUser->getId() != ANONYMOUS_USER_ID)
 
  235                         $ntpl->setCurrentBlock(
"notes_col");
 
  237                         $ntpl->parseCurrentBlock();
 
  241                 $comments_col = 
false;
 
  242                 if ($this->public_enabled && (!$this->delete_note || $this->public_deletion_enabled)
 
  248                         $comments_col = 
true;
 
  252                 if ($this->comments_settings && !$hide_comments && !$this->delete_note
 
  253                         && !$this->edit_note_form && !$this->add_note_form)
 
  255                         $notes_settings = 
new ilSetting(
"notes");
 
  256                         $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
 
  257                         $active = $notes_settings->get(
"activate_".$id);
 
  259                         $ntpl->setCurrentBlock(
"comments_settings");
 
  262                                 $ntpl->setVariable(
"TXT_COMMENTS_SETTINGS", $lng->txt(
"notes_deactivate_comments"));
 
  263                                 $ntpl->setVariable(
"HREF_COMMENTS_SETTINGS",
 
  264                                         $ilCtrl->getLinkTargetByClass(
"ilnotegui", 
"deactivateComments", 
"notes_top"));
 
  268                                 $ntpl->setVariable(
"TXT_COMMENTS_SETTINGS", $lng->txt(
"notes_activate_comments"));
 
  269                                 $ntpl->setVariable(
"HREF_COMMENTS_SETTINGS",
 
  270                                         $ilCtrl->getLinkTargetByClass(
"ilnotegui", 
"activateComments", 
"notes_top"));
 
  272                         $ntpl->parseCurrentBlock();
 
  273                         $comments_col = 
true;
 
  278                         $ntpl->setCurrentBlock(
"comments_col");
 
  282                                 $ntpl->touchBlock(
"comments_style");
 
  285                         $ntpl->parseCurrentBlock();
 
  288                 switch(
$_GET[
"note_mess"] != 
"" ? 
$_GET[
"note_mess"] : $this->note_mess)
 
  292                                 $mtxt = $lng->txt(
"msg_obj_modified");
 
  297                                 $mtxt = $lng->txt(
"notes_notes_deleted");
 
  302                                 $mtxt = $lng->txt(
"notes_note_deleted");
 
  307                                 $mtxt = $lng->txt(
"form_input_not_valid");
 
  312                                 $mtxt = $lng->txt(
"info_delete_sure");
 
  317                                 $mtxt = $lng->txt(
"no_checkbox");
 
  323                         $ntpl->setVariable(
"NOTE_MESS", $ntpl->getMessageHTML($mtxt, $mtype));
 
  336                 $notes_settings = 
new ilSetting(
"notes");
 
  338                 if ($this->comments_settings)
 
  340                         $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
 
  341                         $notes_settings->set(
"activate_".$id, 1);
 
  344                 $ilCtrl->redirectByClass(
"ilnotegui", 
"getNotesHtml");
 
  354                 $notes_settings = 
new ilSetting(
"notes");
 
  356                 if ($this->comments_settings)
 
  358                         $id = $this->rep_obj_id.
"_".$this->obj_id.
"_".$this->obj_type;
 
  359                         $notes_settings->set(
"activate_".$id, 0);
 
  362                 $ilCtrl->redirectByClass(
"ilnotegui", 
"getNotesHtml");
 
  370                 global 
$lng, 
$ilCtrl, $ilUser, $ilAccess, $tree, $objDefinition;
 
  376                 if ($this->delete_note || $this->export_html || $this->print)
 
  378                         if (
$_GET[
"note_id"] != 
"")
 
  380                                 $filter = 
$_GET[
"note_id"];
 
  388                         $this->obj_type, $a_type, $this->inc_sub, $filter,
 
  391                         $this->obj_type, $a_type, $this->inc_sub, $filter,
 
  392                         "", $this->public_deletion_enabled);
 
  394                 $tpl = 
new ilTemplate(
"tpl.notes_list.html", 
true, 
true, 
"Services/Notes");
 
  397                 $cnt_str = (count($all_notes) > 0)
 
  398                         ? 
" (".count($all_notes).
")" 
  401                 if (!$this->export_html)
 
  403                         $tpl->setCurrentBlock(
"notes_img");
 
  407                                 $tpl->setVariable(
"ALT_NOTES", $lng->txt(
"icon").
" ".$lng->txt(
"notes_public_comments"));
 
  412                                 $tpl->setVariable(
"ALT_NOTES", $lng->txt(
"icon").
" ".$lng->txt(
"private_notes"));
 
  414                         $tpl->parseCurrentBlock();
 
  417                 if ($this->delete_note)
 
  423                         $tpl->setVariable(
"TXT_NOTES", $lng->txt(
"private_notes").$cnt_str);
 
  424                         $ilCtrl->setParameterByClass(
"ilnotegui", 
"note_type", 
IL_NOTE_PRIVATE);
 
  428                         $tpl->setVariable(
"TXT_NOTES", $lng->txt(
"notes_public_comments").$cnt_str);
 
  429                         $ilCtrl->setParameterByClass(
"ilnotegui", 
"note_type", 
IL_NOTE_PUBLIC);
 
  431                 $anch = $this->anchor_jump
 
  434                 $tpl->setVariable(
"FORMACTION", $ilCtrl->getFormAction($this, 
"getNotesHTML", $anch));
 
  436                 if ($this->export_html || $this->print)
 
  438                         $tpl->touchBlock(
"print_style");
 
  442                 if (!$this->add_note_form && !$this->edit_note_form && !$this->delete_note &&
 
  443                         !$this->export_html && !$this->print &&
 
  444                         ($ilUser->getId() != ANONYMOUS_USER_ID))
 
  450                                         $tpl->setCurrentBlock(
"add_note_btn");
 
  453                                                 $tpl->setVariable(
"TXT_ADD_NOTE", $lng->txt(
"notes_add_comment"));
 
  457                                                 $tpl->setVariable(
"TXT_ADD_NOTE", $lng->txt(
"add_note"));
 
  459                                         $tpl->setVariable(
"LINK_ADD_NOTE", $ilCtrl->getLinkTargetByClass(
"ilnotegui", 
"addNoteForm").
 
  461                                         $tpl->parseCurrentBlock();
 
  467                 if (count($all_notes) > 0 && $this->enable_hiding && !$this->delete_note
 
  468                         && !$this->export_html && !$this->print && !$this->edit_note_form
 
  469                         && !$this->add_note_form)
 
  471                         if ($ilUser->getPref(
"notes_".$suffix) == 
"n")
 
  473                                 $tpl->setCurrentBlock(
"show_notes");
 
  474                                 $tpl->setVariable(
"LINK_SHOW_NOTES",
 
  475                                         $this->ctrl->getLinkTargetByClass(
"ilnotegui", 
"showNotes", 
"notes_top"));
 
  478                                         $tpl->setVariable(
"TXT_SHOW_NOTES", $lng->txt(
"notes_show_comments"));
 
  482                                         $tpl->setVariable(
"TXT_SHOW_NOTES", $lng->txt(
"show_".$suffix.
"_notes"));
 
  484                                 $tpl->parseCurrentBlock();
 
  489                                 if (($ilUser->getId() != ANONYMOUS_USER_ID))
 
  491                                         $tpl->setCurrentBlock(
"hide_notes");
 
  492                                         $tpl->setVariable(
"LINK_HIDE_NOTES",
 
  493                                                 $this->ctrl->getLinkTargetByClass(
"ilnotegui", 
"hideNotes", 
"notes_top"));
 
  496                                                 $tpl->setVariable(
"TXT_HIDE_NOTES", $lng->txt(
"notes_hide_comments"));
 
  500                                                 $tpl->setVariable(
"TXT_HIDE_NOTES", $lng->txt(
"hide_".$suffix.
"_notes"));
 
  502                                         $tpl->parseCurrentBlock();
 
  507                                                 if ($ilUser->getPref(
"notes_pub_all") == 
"n")
 
  509                                                         $tpl->setCurrentBlock(
"all_pub_notes");
 
  510                                                         $tpl->setVariable(
"LINK_ALL_PUB_NOTES",
 
  511                                                                 $this->ctrl->getLinkTargetByClass(
"ilnotegui", 
"showAllPublicNotes", 
"notes_top"));
 
  512                                                         $tpl->setVariable(
"TXT_ALL_PUB_NOTES", $lng->txt(
"notes_all_comments"));
 
  513                                                         $tpl->parseCurrentBlock();
 
  517                                                         $tpl->setCurrentBlock(
"my_pub_notes");
 
  518                                                         $tpl->setVariable(
"LINK_MY_PUB_NOTES",
 
  519                                                                 $this->ctrl->getLinkTargetByClass(
"ilnotegui", 
"showMyPublicNotes", 
"notes_top"));
 
  520                                                         $tpl->setVariable(
"TXT_MY_PUB_NOTES", $lng->txt(
"notes_my_comments"));
 
  521                                                         $tpl->parseCurrentBlock();
 
  529                 if ($this->add_note_form && $a_type == 
$_GET[
"note_type"])
 
  536                         $tpl->setCurrentBlock(
"edit_note_form");
 
  537                         $tpl->setVariable(
"EDIT_FORM", $this->form->getHTML());
 
  538                         $tpl->parseCurrentBlock();
 
  540                         $tpl->parseCurrentBlock();
 
  541                         $tpl->setCurrentBlock(
"note_row");
 
  542                         $tpl->parseCurrentBlock();
 
  546                 if ($ilUser->getPref(
"notes_".$suffix) != 
"n" || !$this->enable_hiding)
 
  548                         foreach($notes as $note)
 
  550                                 if ($this->edit_note_form && ($note->getId() == 
$_GET[
"note_id"])
 
  551                                         && $a_type == 
$_GET[
"note_type"])
 
  557                                         $tpl->setCurrentBlock(
"edit_note_form");
 
  558                                         $tpl->setVariable(
"EDIT_FORM", $this->form->getHTML());
 
  559                                         $tpl->parseCurrentBlock();
 
  567                                                 && !$this->delete_note
 
  568                                                 && !$this->export_html && !$this->print
 
  569                                                 && !$this->edit_note_form && !$this->add_note_form)
 
  571                                                 $tpl->setCurrentBlock(
"delete_note");
 
  572                                                 $tpl->setVariable(
"TXT_DELETE_NOTE", $lng->txt(
"delete"));
 
  573                                                 $ilCtrl->setParameterByClass(
"ilnotegui", 
"note_id", $note->getId());
 
  574                                                 $tpl->setVariable(
"LINK_DELETE_NOTE",
 
  575                                                         $ilCtrl->getLinkTargetByClass(
"ilnotegui", 
"deleteNote")
 
  576                                                         .
"#note_".$note->getId());
 
  577                                                 $tpl->parseCurrentBlock();
 
  581                                         if ($this->multi_selection && !$this->delete_note)
 
  583                                                 $tpl->setCurrentBlock(
"checkbox_col");
 
  584                                                 $tpl->setVariable(
"CHK_NOTE", 
"note[]");
 
  585                                                 $tpl->setVariable(
"CHK_NOTE_ID", $note->getId());
 
  586                                                 $tpl->parseCurrentBlock();
 
  594                                                 if (!$this->delete_note && !$this->export_html && !$this->print
 
  595                                                         && !$this->edit_note_form && !$this->add_note_form)
 
  597                                                         $tpl->setCurrentBlock(
"edit_note");
 
  598                                                         $tpl->setVariable(
"TXT_EDIT_NOTE", $lng->txt(
"edit"));
 
  599                                                         $ilCtrl->setParameterByClass(
"ilnotegui", 
"note_id", $note->getId());
 
  600                                                         $tpl->setVariable(
"LINK_EDIT_NOTE",
 
  601                                                                 $ilCtrl->getLinkTargetByClass(
"ilnotegui", 
"editNoteForm")
 
  603                                                         $tpl->parseCurrentBlock();
 
  607                                         $tpl->setVariable(
"CNT_COL", $cnt_col);
 
  612                                                 $tpl->setCurrentBlock(
"author");
 
  614                                                 $tpl->parseCurrentBlock();
 
  615                                                 $tpl->setCurrentBlock(
"user_img");
 
  616                                                 $tpl->setVariable(
"USR_IMG",
 
  618                                                 $tpl->setVariable(
"USR_ALT", $lng->txt(
"user_image").
": ".
 
  620                                                 $tpl->setVariable(
"TXT_USR",
 
  622                                                 $tpl->parseCurrentBlock();
 
  626                                         if ($note->getUpdateDate() != null)
 
  628                                                 $tpl->setCurrentBlock(
"last_edit");
 
  629                                                 $tpl->setVariable(
"TXT_LAST_EDIT", $lng->txt(
"last_edited_on"));
 
  630                                                 $tpl->setVariable(
"DATE_LAST_EDIT",
 
  632                                                 $tpl->parseCurrentBlock();
 
  636                                         if ($this->delete_note)
 
  638                                                 $tpl->setCurrentBlock(
"delete_ids");
 
  639                                                 $tpl->setVariable(
"HID_NOTE", 
"note[]");
 
  640                                                 $tpl->setVariable(
"HID_NOTE_ID", $note->getId());
 
  641                                                 $tpl->parseCurrentBlock();                                              
 
  643                                         $target = $note->getObject();
 
  647                                                 $target[
"obj_type"], $target[
"obj_id"]);
 
  649                                         $rowclass = ($rowclass != 
"tblrow1")
 
  652                                         if (!$this->export_html && !$this->print)
 
  654                                                 $tpl->setCurrentBlock(
"note_img");
 
  657                                                         $tpl->setVariable(
"IMG_NOTE", $this->comment_img[$note->getLabel()][
"img"]);
 
  658                                                         $tpl->setVariable(
"ALT_NOTE", $this->comment_img[$note->getLabel()][
"alt"]);
 
  662                                                         $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
 
  663                                                         $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
 
  665                                                 $tpl->parseCurrentBlock();
 
  669                                                 switch ($note->getLabel())
 
  672                                                                 $tpl->setVariable(
"EXP_ICON", 
"[ ]");
 
  676                                                                 $tpl->setVariable(
"EXP_ICON", 
"[!]");
 
  680                                                                 $tpl->setVariable(
"EXP_ICON", 
"[?]");
 
  684                                                                 $tpl->setVariable(
"EXP_ICON", 
"[+]");
 
  688                                                                 $tpl->setVariable(
"EXP_ICON", 
"[-]");
 
  692                                         $tpl->setCurrentBlock(
"note");
 
  693                                         $tpl->setVariable(
"ROWCLASS", $rowclass);
 
  694                                         $tpl->setVariable(
"TXT_DATE", $lng->txt(
"date"));
 
  695                                         $tpl->setVariable(
"TXT_CREATED", $lng->txt(
"create_date"));
 
  696                                         $tpl->setVariable(
"VAL_DATE",
 
  698                                         $tpl->setVariable(
"NOTE_TEXT", nl2br($note->getText()));
 
  699                                         $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
 
  700                                         $tpl->setVariable(
"NOTE_ID", $note->getId());
 
  701                                         $tpl->parseCurrentBlock();
 
  703                                 $tpl->setCurrentBlock(
"note_row");
 
  704                                 $tpl->parseCurrentBlock();
 
  708                         if ($this->multi_selection && !$this->delete_note && !$this->edit_note_form
 
  709                                 && count($notes) > 0)
 
  713                                         $tpl->setCurrentBlock(
"delete_cmd");
 
  714                                         $tpl->setVariable(
"TXT_DELETE_NOTES", $this->lng->txt(
"delete"));
 
  715                                         $tpl->parseCurrentBlock();
 
  718                                 $tpl->setCurrentBlock(
"multiple_commands");
 
  719                                 $tpl->setVariable(
"TXT_SELECT_ALL", $this->lng->txt(
"select_all"));
 
  721                                 $tpl->setVariable(
"ALT_ARROW", $this->lng->txt(
"actions"));
 
  722                                 $tpl->setVariable(
"TXT_PRINT_NOTES", $this->lng->txt(
"print"));
 
  723                                 $tpl->setVariable(
"TXT_EXPORT_NOTES", $this->lng->txt(
"exp_html"));
 
  724                                 $tpl->parseCurrentBlock();
 
  728                         if ($this->delete_note)
 
  730                                 $tpl->setCurrentBlock(
"delete_cancel");
 
  731                                 $tpl->setVariable(
"TXT_DEL_NOTES", $this->lng->txt(
"delete"));
 
  732                                 $tpl->setVariable(
"TXT_CANCEL_DEL_NOTES", $this->lng->txt(
"cancel"));
 
  733                                 $tpl->parseCurrentBlock();
 
  739                                 $tpl->touchBlock(
"print_js");
 
  740                                 $tpl->setCurrentBlock(
"print_back");
 
  741                                 $tpl->setVariable(
"LINK_BACK", $this->ctrl->getLinkTarget($this, 
"showNotes"));
 
  742                                 $tpl->setVariable(
"TXT_BACK", $this->lng->txt(
"back"));
 
  743                                 $tpl->parseCurrentBlock();
 
  747                 if ($this->delete_note && count($notes) == 0)
 
  764                 if ($ilUser->getId() == ANONYMOUS_USER_ID)
 
  770                 if (($a_note->getType() == 
IL_NOTE_PRIVATE && $a_note->getAuthor() == $ilUser->getId()) ||
 
  788                 if ($a_note->getAuthor() == $ilUser->getId()
 
  789                         && ($ilUser->getId() != ANONYMOUS_USER_ID))
 
  802         public function initNoteForm($a_mode = 
"edit", $a_type, $a_note = null)
 
  806                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
  808                 $this->form->setOpenTag(
false);
 
  809                 $this->form->setCloseTag(
false);
 
  810                 $this->form->setDisableStandardMessage(
true);
 
  815                 $ti->setMaxLength(200);
 
  819                         $ti->setValue($a_note->getSubject());
 
  821                 $this->form->addItem($ti);
 
  825                         ? $lng->txt(
"notes_comment")
 
  826                         : $lng->txt(
"note"), 
"note");
 
  831                         $ta->setValue($a_note->getText());
 
  833                 $this->form->addItem($ta);
 
  847                         $si->setValue($a_note->getLabel());
 
  849                 $this->form->addItem($si);
 
  855                         $hi->setValue(
$_GET[
"note_id"]);
 
  856                         $this->form->addItem($hi);
 
  860                 if ($a_mode == 
"create")
 
  862                         $this->form->addCommandButton(
"addNote", $lng->txt(
"save"));
 
  863                         $this->form->addCommandButton(
"cancelAddNote", $lng->txt(
"cancel"));
 
  865                                 ? $lng->txt(
"notes_add_comment")
 
  866                                 : $lng->txt(
"notes_add_note"));
 
  870                         $this->form->addCommandButton(
"updateNote", $lng->txt(
"save"));
 
  871                         $this->form->addCommandButton(
"cancelUpdateNote", $lng->txt(
"cancel"));
 
  873                                 ? $lng->txt(
"notes_edit_comment")
 
  874                                 : $lng->txt(
"notes_edit_note"));
 
  877                 $ilCtrl->setParameter($this, 
"note_type", $a_type);
 
  878                 $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  889                 $tpl = 
new ilTemplate(
"tpl.pd_note.html", 
true, 
true, 
"Services/Notes");
 
  890                 $note = 
new ilNote($note_id);
 
  891                 $target = $note->getObject();
 
  893                 if ($note->getAuthor() != $ilUser->getId())
 
  899                 $alt = $lng->txt(
"note");
 
  901                 $tpl->setCurrentBlock(
"edit_note");
 
  902                 $ilCtrl->setParameterByClass(
"ilnotegui", 
"rel_obj", $target[
"rep_obj_id"]);
 
  903                 $ilCtrl->setParameterByClass(
"ilnotegui", 
"note_id", $note_id);
 
  904                 $ilCtrl->setParameterByClass(
"ilnotegui", 
"note_type", $note->getType());
 
  905                 $tpl->setVariable(
"LINK_EDIT_NOTE",
 
  906                         $ilCtrl->getLinkTargetByClass(array(
"ilpersonaldesktopgui", 
"ilpdnotesgui", 
"ilnotegui"),
 
  908                 $tpl->setVariable(
"TXT_EDIT_NOTE", $lng->txt(
"edit"));
 
  909                 $tpl->parseCurrentBlock();
 
  910                 $ilCtrl->clearParametersByClass(
"ilnotegui");
 
  912                 $tpl->setCurrentBlock(
"note_img");
 
  913                 $tpl->setVariable(
"IMG_NOTE", $this->note_img[$note->getLabel()][
"img"]);
 
  914                 $tpl->setVariable(
"ALT_NOTE", $this->note_img[$note->getLabel()][
"alt"]);
 
  915                 $tpl->parseCurrentBlock();
 
  918                 if ($note->getUpdateDate() != null)
 
  920                         $tpl->setCurrentBlock(
"last_edit");
 
  921                         $tpl->setVariable(
"TXT_LAST_EDIT", $lng->txt(
"last_edited_on"));
 
  922                         $tpl->setVariable(
"DATE_LAST_EDIT",
 
  924                         $tpl->parseCurrentBlock();
 
  927                 $tpl->setVariable(
"TXT_CREATED", $lng->txt(
"create_date"));
 
  928                 $tpl->setVariable(
"VAL_DATE",
 
  930                 $tpl->setVariable(
"VAL_SUBJECT", $note->getSubject());
 
  931                 $tpl->setVariable(
"NOTE_TEXT", nl2br($note->getText()));
 
  932                 $this->
showTargets(
$tpl, $target[
"rep_obj_id"], $note_id, $target[
"obj_type"], $target[
"obj_id"]);
 
  941                 global $tree, $ilAccess, $objDefinition;
 
  943                 if ($this->targets_enabled)
 
  945                         if ($a_rep_obj_id > 0)
 
  950                                 $vis_ref_ids = array();
 
  954                                         if ($ilAccess->checkAccess(
"visible", 
"", $ref_id))
 
  961                                 if (count($vis_ref_ids) > 0)
 
  963                                         foreach($vis_ref_ids as $vis_ref_id)
 
  966                                                 $sub_link = $sub_title = 
"";
 
  969                                                         $link = 
"goto.php?target=sahs_".$vis_ref_id;
 
  971                                                         if ($a_obj_type == 
"sco" || $a_obj_type == 
"seqc" || $a_obj_type == 
"chap" || $a_obj_type == 
"pg")
 
  973                                                                 $sub_link = 
"goto.php?target=sahs_".$vis_ref_id.
"_".$a_obj_id;
 
  974                                                                 include_once(
"./Modules/Scorm2004/classes/class.ilSCORM2004Node.php");
 
  979                                                 else if ($a_obj_type != 
"pg")
 
  981                                                         if (!is_object($this->item_list_gui[$type]))
 
  983                                                                 $class = $objDefinition->getClassName($type);
 
  984                                                                 $location = $objDefinition->getLocation($type);
 
  985                                                                 $full_class = 
"ilObj".$class.
"ListGUI";
 
  986                                                                 include_once(
$location.
"/class.".$full_class.
".php");
 
  987                                                                 $this->item_list_gui[$type] = 
new $full_class();
 
  990                                                         $this->item_list_gui[$type]->initItem($vis_ref_id, $a_rep_obj_id, 
$title);
 
  991                                                         $link = $this->item_list_gui[$type]->getCommandLink(
"infoScreen");
 
  996                                                         $link = $this->item_list_gui[$type]->appendRepositoryFrameParameter($link).
"#note_".$a_note_id;
 
 1001                                                         $link = 
"goto.php?target=pg_".$a_obj_id.
"_".$vis_ref_id;
 
 1004                                                 $par_id = $tree->getParentId($vis_ref_id);
 
 1007                                                 if ($sub_link != 
"")
 
 1009                                                         if ($this->export_html || $this->print)
 
 1011                                                                 $tpl->setCurrentBlock(
"exp_target_sub_object");
 
 1015                                                                 $tpl->setCurrentBlock(
"target_sub_object");
 
 1016                                                                 $tpl->setVariable(
"LINK_SUB_TARGET", $sub_link);
 
 1018                                                         $tpl->setVariable(
"TXT_SUB_TARGET", $sub_title);
 
 1019                                                         $tpl->setVariable(
"IMG_SUB_TARGET", $sub_icon);
 
 1020                                                         $tpl->parseCurrentBlock();
 
 1024                                                 if ($this->export_html || $this->print)
 
 1026                                                         $tpl->setCurrentBlock(
"exp_target_object");
 
 1030                                                         $tpl->setCurrentBlock(
"target_object");
 
 1031                                                         $tpl->setVariable(
"LINK_TARGET", $link);
 
 1033                                                 $tpl->setVariable(
"TXT_CONTAINER",
 
 1036                                                 $tpl->setVariable(
"IMG_CONTAINER",
 
 1040                                                 $tpl->setVariable(
"IMG_TARGET",
 
 1043                                                 $tpl->parseCurrentBlock();
 
 1045                                         $tpl->touchBlock(
"target_objects");
 
 1061                 $ilUser->setPref(
"notes_".$suffix, 
"y");
 
 1063                 $this->add_note_form = 
true;
 
 1092                 if ($this->form->checkInput())
 
 1095                         $note->setObject($this->obj_type, $this->rep_obj_id, $this->obj_id);                    
 
 1096                         $note->setType(
$_GET[
"note_type"]);
 
 1097                         $note->setAuthor($ilUser->getId());
 
 1098                         $note->setText(
$_POST[
"note"]);
 
 1099                         $note->setSubject(
$_POST[
"sub_note"]);
 
 1100                         $note->setLabel(
$_POST[
"note_label"]);
 
 1102                         $ilCtrl->setParameter($this, 
"note_mess", 
"mod");
 
 1103                         $ilCtrl->redirect($this, 
"showNotes", 
"notes_top");
 
 1106                 $this->note_mess = 
"frmfld";
 
 1107                 $this->form->setValuesByPost();
 
 1122                 if ($this->form->checkInput())
 
 1124                         $note->setText(
$_POST[
"note"]);
 
 1125                         $note->setSubject(
$_POST[
"sub_note"]);
 
 1126                         $note->setLabel(
$_POST[
"note_label"]);
 
 1130                                 $ilCtrl->setParameter($this, 
"note_mess", 
"mod");
 
 1132                         $ilCtrl->redirect($this, 
"showNotes", 
"notes_top");
 
 1135                 $this->note_mess = 
"frmfld";
 
 1136                 $this->form->setValuesByPost();
 
 1137                 $_GET[
"note_id"] = $note->getId();
 
 1138                 $_GET[
"note_type"] = $note->getType();
 
 1147                 $this->edit_note_form = 
true;
 
 1157                 $this->delete_note = 
true;
 
 1158                 $this->note_mess = 
"qdel";
 
 1171                         $this->note_mess = 
"noc";
 
 1175                         $this->delete_note = 
true;
 
 1176                         $this->note_mess = 
"qdel";
 
 1198                 foreach(
$_POST[
"note"] as $id)
 
 1209                         $ilCtrl->setParameter($this, 
"note_mess", 
"ntsdel");
 
 1213                         $ilCtrl->setParameter($this, 
"note_mess", 
"ntdel");
 
 1215                 $ilCtrl->redirect($this, 
"showNotes", 
"notes_top");
 
 1225                 $this->export_html = 
true;
 
 1226                 $this->multi_selection = 
false;
 
 1238                 $this->print = 
true;
 
 1239                 $this->multi_selection = 
false;
 
 1254                 $ilUser->writePref(
"notes_".$suffix, 
"y");
 
 1269                 $ilUser->writePref(
"notes_".$suffix, 
"n");
 
 1281                 $ilUser->writePref(
"notes_pub_all", 
"y");
 
 1293                 $ilUser->writePref(
"notes_pub_all", 
"n");