5 require_once(
'./Services/Object/classes/class.ilObject2.php');
6 require_once(
'class.ilDataCollectionTable.php');
7 require_once(
'class.ilDataCollectionCache.php');
35 $result = $ilDB->query(
"SELECT * FROM il_dcl_data WHERE id = " . $ilDB->quote($this->getId(),
"integer"));
37 $data = $ilDB->fetchObject(
$result);
50 $ilLog->write(
'doCreate');
53 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionTable.php');
55 $main_table->setObjId($this->
getId());
56 $main_table->setTitle($this->
getTitle());
57 $main_table->setAddPerm(1);
58 $main_table->setEditPerm(1);
59 $main_table->setDeletePerm(1);
60 $main_table->setEditByOwner(1);
61 $main_table->setLimited(0);
62 $main_table->doCreate();
64 $ilDB->insert(
"il_dcl_data", array(
65 "id" => array(
"integer", $this->
getId() ),
66 "main_table_id" => array(
"integer", (
int)$main_table->getId() ),
67 "is_online" => array(
"integer", (
int)$this->
getOnline() ),
68 "rating" => array(
"integer", (
int)$this->
getRating() ),
69 "public_notes" => array(
"integer", (
int)$this->
getPublicNotes() ),
70 "approval" => array(
"integer", (
int)$this->
getApproval() ),
89 $table->doDelete(
true);
92 $query =
"DELETE FROM il_dcl_data WHERE id = " . $ilDB->quote($this->
getId(),
"integer");
100 $ilDB->update(
"il_dcl_data", array(
101 "id" => array(
"integer", $this->
getId() ),
102 "main_table_id" => array(
"integer", (
int)$this->
getMainTableId() ),
103 "is_online" => array(
"integer", (
int)$this->
getOnline() ),
104 "rating" => array(
"integer", (
int)$this->
getRating() ),
105 "public_notes" => array(
"integer", (
int)$this->
getPublicNotes() ),
106 "approval" => array(
"integer", (
int)$this->
getApproval() ),
109 "id" => array(
"integer", $this->
getId() )
123 if (
$_GET[
'ref_id'] == SYSTEM_FOLDER_ID) {
129 if ($dclObj->getNotification() != 1) {
133 $obj_dcl = $obj_table->getCollectionObject();
136 require_once(
'./Services/Notification/classes/class.ilNotification.php');
138 if (!
sizeof($users)) {
145 require_once(
'./Services/Link/classes/class.ilLink.php');
150 require_once(
'./Services/Language/classes/class.ilLanguageFactory.php');
153 require_once(
'./Services/Mail/classes/class.ilMail.php');
154 require_once(
'./Services/User/classes/class.ilObjUser.php');
155 require_once(
'./Services/Language/classes/class.ilLanguageFactory.php');
156 require_once(
'./Services/User/classes/class.ilUserUtil.php');
157 require_once(
'./Services/User/classes/class.ilUserUtil.php');
158 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionTable.php');
160 foreach (array_unique($users) as $idx => $user_id) {
163 if ($user_id != $ilUser->getId() && $ilAccess->checkAccessOfUser($user_id,
'read',
'',
$_GET[
'ref_id'])) {
166 $ulng->loadLanguageModule(
'dcl');
168 $subject = sprintf($ulng->txt(
'dcl_change_notification_subject'), $obj_dcl->getTitle());
171 $message .= $ulng->txt(
'dcl_change_notification_dcl_' . $a_action) .
":\n\n";
172 $message .= $ulng->txt(
'obj_dcl') .
": " . $obj_dcl->getTitle() .
"\n\n";
173 $message .= $ulng->txt(
'dcl_table') .
": " . $obj_table->getTitle() .
"\n\n";
174 $message .= $ulng->txt(
'dcl_record') .
":\n";
175 $message .=
"------------------------------------\n";
178 if (! $record->getTableId()) {
179 $record->setTableId($a_table_id);
183 foreach ($record->getTable()->getVisibleFields() as $field) {
184 if ($record->getRecordField($field->getId())) {
185 $t .= $field->getTitle() .
": " . $record->getRecordField($field->getId())->getPlainText() .
"\n";
188 $message .=
$t .
"\n";
190 $message .=
"------------------------------------\n";
193 $message .= $ulng->txt(
'dcl_change_notification_link') .
": " . $link .
"\n\n";
195 $message .= $ulng->txt(
'dcl_change_why_you_receive_this_email');
197 $mail_obj =
new ilMail(ANONYMOUS_USER_ID);
198 $mail_obj->appendInstallationSignature(
true);
199 $mail_obj->sendMail(
ilObjUser::_lookupLogin($user_id),
"",
"", $subject, $message, array(), array(
"system" ));
211 $this->main_table_id = $a_val;
237 if(!$cp_options->isRootNode($this->getRefId()))
289 $this->
setRating($original->getRating());
293 $table->doDelete(
true);
297 foreach ($original->getTables() as $table) {
299 $new_table->setObjId($this->
getId());
300 $new_table->cloneStructure($table);
302 if ($table->getId() == $original->getMainTableId()) {
311 foreach ($original->getTables() as $origTable) {
312 foreach ($origTable->getRecordFields() as $origField) {
321 $newRefId = $field->getId();
338 $this->is_online = $a_val;
346 return $this->is_online;
354 $this->rating = $a_val;
362 return $this->rating;
370 $this->public_notes = $a_val;
378 return $this->public_notes;
386 $this->approval = $a_val;
394 return $this->approval;
402 $this->notification = $a_val;
410 return $this->notification;
442 $query =
"SELECT id FROM il_dcl_table WHERE obj_id = " . $ilDB->quote($this->
getId(),
"integer");
443 $set = $ilDB->query(
$query);
446 while ($rec = $ilDB->fetchAssoc($set)) {
460 if ($table->getIsVisible()) {
461 $tables[$table->getId()] = $table;
479 $result = $ilDB->query(
'SELECT * FROM il_dcl_table WHERE obj_id = ' . $ilDB->quote($obj_id,
'integer') .
' AND title = '
480 . $ilDB->quote(
$title,
'text'));
482 return ($ilDB->numRows(
$result)) ?
true :
false;