33 protected \ILIAS\Notes\Service
$notes;
40 $this->notes = $DIC->notes();
46 return array(
"4.4.0",
"5.0.0");
49 protected function getXmlNamespace(
string $a_entity,
string $a_schema_version): string
51 return "https://www.ilias.de/xml/Modules/Portfolio/" . $a_entity;
54 protected function getTypes(
string $a_entity,
string $a_version): array
56 if ($a_entity ===
"prtt") {
63 "Description" =>
"text",
64 "Comments" =>
"integer",
66 "FontColor" =>
"text",
74 if ($a_entity ===
"portfolio_page") {
80 "PortfolioId" =>
"integer",
82 "OrderNr" =>
"integer",
90 public function readData(
string $a_entity,
string $a_version, array $a_ids): void
94 if (!is_array($a_ids)) {
95 $a_ids = array($a_ids);
98 if ($a_entity ===
"prtt") {
102 "prtf.comments,prtf.bg_color,prtf.font_color,prtf.img,prtf.ppic" .
103 " FROM usr_portfolio prtf" .
104 " JOIN object_data od ON (od.obj_id = prtf.id)" .
105 " WHERE " .
$ilDB->in(
"prtf.id", $a_ids,
false,
"integer") .
106 " AND od.type = " .
$ilDB->quote(
"prtt",
"text"));
111 "prtf.bg_color,prtf.font_color,prtf.img,prtf.ppic" .
112 " FROM usr_portfolio prtf" .
113 " JOIN object_data od ON (od.obj_id = prtf.id)" .
114 " WHERE " .
$ilDB->in(
"prtf.id", $a_ids,
false,
"integer") .
115 " AND od.type = " .
$ilDB->quote(
"prtt",
"text"));
120 if ($a_entity ===
"portfolio_page") {
121 switch ($a_version) {
125 " FROM usr_portfolio_page" .
126 " WHERE " .
$ilDB->in(
"portfolio_id", $a_ids,
false,
"integer"));
135 ?array $a_rec = null,
138 if ($a_entity ===
"prtt") {
140 "portfolio_page" => array(
"ids" => $a_rec[
"Id"] ?? null)
151 if ($a_entity ===
"prtt") {
153 $a_set[
"Dir"] = $dir;
155 $a_set[
"Comments"] = $this->notes->domain()->commentsActive((
int) $a_set[
"Id"]);
167 string $a_schema_version
174 if ($new_id = $a_mapping->
getMapping(
"Services/Container",
"objs", $a_rec[
"Id"])) {
181 $newObj->setTitle($a_rec[
"Title"]);
182 $newObj->setDescription($a_rec[
"Description"]);
183 $newObj->setPublicComments($a_rec[
"Comments"]);
184 $newObj->setBackgroundColor($a_rec[
"BgColor"]);
185 $newObj->setFontColor($a_rec[
"FontColor"]);
186 $newObj->setProfilePicture($a_rec[
"Ppic"]);
187 $newObj->setImage($a_rec[
"Img"]);
192 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
200 $a_mapping->
addMapping(
"Modules/Portfolio",
"prtt", $a_rec[
"Id"], $newObj->getId());
201 $a_mapping->
addMapping(
"Services/Object",
"obj", $a_rec[
"Id"], $newObj->getId());
204 case "portfolio_page":
205 $prtt_id = (
int) $a_mapping->
getMapping(
"Modules/Portfolio",
"prtt", $a_rec[
"PortfolioId"]);
208 $newObj->setPortfolioId($prtt_id);
209 $newObj->setTitle($a_rec[
"Title"]);
210 $newObj->setType($a_rec[
"Type"]);
211 $newObj->setOrderNr($a_rec[
"OrderNr"]);
212 $newObj->create(
true);
214 $a_mapping->
addMapping(
"Services/COPage",
"pg",
"prtt:" . $a_rec[
"Id"],
"prtt:" . $newObj->getId());
ilObjPortfolio $current_portfolio
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTypes(string $a_entity, string $a_version)
static initStorage(int $a_id, string $a_subdir=null)
Init file system storage.
getXmlRecord(string $a_entity, string $a_version, array $a_set)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDependencies(string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
getXmlNamespace(string $a_entity, string $a_schema_version)
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
getMapping(string $a_comp, string $a_entity, string $a_old_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Notes Service $notes
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
__construct(Container $dic, ilPlugin $plugin)
stripTags(array $rec, array $omit_keys=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
readData(string $a_entity, string $a_version, array $a_ids)