26 protected \ILIAS\Notes\Service
$notes;
32 protected string $img =
"";
38 bool $a_reference =
true 42 $this->notes = $DIC->notes();
46 $this->setting = $DIC->settings();
48 $this->db = $DIC->database();
58 $this->online = $a_value;
70 $ilDB = $DIC->database();
72 $set =
$ilDB->query(
"SELECT is_online" .
73 " FROM usr_portfolio" .
74 " WHERE id = " .
$ilDB->quote($a_id,
"integer"));
75 $row =
$ilDB->fetchAssoc($set);
76 return (
bool) $row[
"is_online"];
81 $this->comments = $a_value;
96 $this->ppic = $a_status;
101 if (!$this->bg_color) {
102 $this->bg_color =
"ffffff";
112 $this->bg_color = $a_value;
117 if (!$this->font_color) {
118 $this->font_color =
"505050";
125 $this->font_color = $a_value;
136 $set =
$ilDB->query(
"SELECT * FROM usr_portfolio" .
137 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
138 $row =
$ilDB->fetchAssoc($set);
140 $this->
setOnline((
bool) $row[
"is_online"]);
158 protected function doCreate(
bool $clone_mode =
false): void
162 $ilDB->manipulate(
"INSERT INTO usr_portfolio (id,is_online)" .
163 " VALUES (" .
$ilDB->quote($this->id,
"integer") .
"," .
164 $ilDB->quote(0,
"integer") .
")");
172 "is_online" => array(
"integer", $this->
isOnline()),
185 array(
"id" => array(
"integer", $this->
id))
202 $ilDB->manipulate(
"DELETE FROM usr_portfolio" .
203 " WHERE id = " .
$ilDB->quote($this->id,
"integer"));
238 $content_style_domain = $DIC
241 ->styleForObjId($a_source->
getId());
242 $content_style_domain->cloneTo($a_target->
getId());
251 ?array $a_recipe =
null,
252 bool $copy_all =
false 256 $lng = $DIC->language();
257 $ilUser = $DIC->user();
258 $skill_personal_service = $DIC->skills()->personal();
260 $source_id = $a_source->
getId();
261 $target_id = $a_target->
getId();
266 } elseif ($a_source instanceof ilObjPortfolio &&
273 self::cloneBasics($a_source, $a_target);
300 if ($rec->getParentObject() == $a_target->
getId()) {
301 $rec->setAssignedObjectTypes(
303 "obj_type" => $target_type,
304 "sub_type" =>
"pfpg",
309 } elseif (!$rec->isAssignedObjectType($target_type,
'pfpg')) {
310 $rec->appendAssignedObjectType(
319 $pskills = array_keys($skill_personal_service->getSelectedUserSkills($ilUser->getId()));
324 $page_id = $page[
"id"];
326 if ($direction ===
"t2p") {
333 $source_page->setPortfolioId($source_id);
334 $target_page->setPortfolioId($target_id);
336 $page_type = $source_page->getType();
337 $page_title = $source_page->getTitle();
343 if (isset($a_recipe)) {
344 $page_recipe = $a_recipe[$page_id] ??
null;
348 switch ($page_type) {
351 $target_page->setXMLContent(
352 $source_page->copyXmlContent(
358 $target_page->buildDom(
true);
362 if ($direction ===
"t2p") {
363 $dom = $target_page->getDomDoc();
366 self::updateDomNodes($dom,
"//PageContent/Profile",
"User", $ilUser->getId());
367 self::updateDomNodes($dom,
"//PageContent/ConsultationHours",
"User", $ilUser->getId());
368 self::updateDomNodes($dom,
"//PageContent/MyCourses",
"User", $ilUser->getId());
372 $nodes = $xpath->query(
"//PageContent/Skills");
373 foreach ($nodes as $node) {
374 $skill_id = $node->getAttribute(
"Id");
377 if (in_array($skill_id, $pskills)) {
378 $node->setAttribute(
"User", $ilUser->getId());
381 elseif ($copy_all || in_array($skill_id, $a_recipe[
"skills"])) {
382 $skill_personal_service->addPersonalSkill($ilUser->getId(), $skill_id);
384 $node->setAttribute(
"User", $ilUser->getId());
388 $page_element = $node->parentNode;
389 $page_element->parentNode->removeChild($page_element);
400 $target_page->setXMLContent($target_page->getXMLFromDom());
402 $target_page->setType($page_type);
403 $target_page->setTitle($page_title);
404 $target_page->create(
false);
407 $target_page->update();
409 $page_map[$source_page->getId()] = $target_page->getId();
422 $nodes = $xpath_temp->query($a_xpath);
423 foreach ($nodes as $node) {
424 $node->setAttribute($a_attr_id, $a_attr_value);
434 if ($this->
getType() ===
"prtt") {
439 if ($page->renameLinksOnTitleChange($a_title_changes)) {
440 $page->update(
true,
true);
static getAllPortfolioPages(int $a_portfolio_id)
Get pages of portfolio.
setProfilePicture(bool $a_status)
ILIAS Notes Service $notes
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFontColor(string $a_value)
setBackgroundColor(string $a_value)
Set background color, e.g.
static cloneBasics(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target)
Clone basic settings.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
setPublicComments(bool $a_value)
static clonePagesAndSettings(ilObjPortfolioBase $a_source, ilObjPortfolioBase $a_target, ?array $a_recipe=null, bool $copy_all=false)
Build template from portfolio and vice versa.
static lookupOnline(int $a_id)
static updateInternalLinks(array $a_copied_nodes, ilObjPortfolioBase $a_target_obj)
Update internal links, after multiple pages have been copied.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _allocateCopyId()
Allocate a copy for further entries.
static updateDomNodes(DOMDocument $a_dom, string $a_xpath, string $a_attr_id, string $a_attr_value)
__construct(int $a_id=0, bool $a_reference=true)
doReadCustom(array $a_row)
May be overwritten by derived classes.
static saveObjRecSelection(int $a_obj_id, string $a_sub_type="", ?array $a_records=null, bool $a_delete_before=true)
Save repository object record selection.
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static _cloneValues(int $copy_id, int $a_source_id, int $a_target_id, ?string $a_sub_type=null, ?int $a_source_sub_id=null, ?int $a_target_sub_id=null)
Clone Advanced Meta Data.
__construct(Container $dic, ilPlugin $plugin)
fixLinksOnTitleChange(array $a_title_changes)
Update internal portfolio links on title change.
doCreate(bool $clone_mode=false)
doUpdateCustom(array &$a_fields)
May be overwritte by derived classes.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _getContainerSettings(int $a_id)