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"));
56 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionTable.php");
58 $main_table->setObjId($this->
getId());
59 $main_table->setTitle($this->
getTitle());
60 $main_table->setAddPerm(1);
61 $main_table->setEditPerm(1);
62 $main_table->setDeletePerm(1);
63 $main_table->setEditByOwner(1);
64 $main_table->setLimited(0);
65 $main_table->doCreate();
67 $ilDB->insert(
"il_dcl_data", array(
68 "id" => array(
"integer", $this->
getId()),
69 "main_table_id" => array(
"integer", (
int) $main_table->getId()),
70 "is_online" => array(
"integer", (
int) $this->
getOnline()),
71 "rating" => array(
"integer", (
int) $this->
getRating()),
73 "approval" => array(
"integer", (
int) $this->
getApproval()),
100 $table->doDelete(
true);
103 $query =
"DELETE FROM il_dcl_data WHERE id = ".$ilDB->quote($this->
getId(),
"integer");
104 $ilDB->manipulate(
$query);
114 $ilDB->update(
"il_dcl_data", array(
115 "id" => array(
"integer", $this->
getId()),
116 "main_table_id" => array(
"integer", (
int) $this->
getMainTableId()),
117 "is_online" => array(
"integer", (
int) $this->
getOnline()),
118 "rating" => array(
"integer", (
int) $this->
getRating()),
119 "public_notes" => array(
"integer", (
int) $this->
getPublicNotes()),
120 "approval" => array(
"integer", (
int) $this->
getApproval()),
124 "id" => array(
"integer", $this->
getId())
138 if (
$_GET[
'ref_id'] == SYSTEM_FOLDER_ID) {
144 if($dclObj->getNotification() != 1)
149 $obj_dcl = $obj_table->getCollectionObject();
152 include_once
"./Services/Notification/classes/class.ilNotification.php";
162 include_once
"./Services/Link/classes/class.ilLink.php";
167 include_once
"./Services/Language/classes/class.ilLanguageFactory.php";
171 include_once
"./Services/Mail/classes/class.ilMail.php";
172 include_once
"./Services/User/classes/class.ilObjUser.php";
173 include_once
"./Services/Language/classes/class.ilLanguageFactory.php";
174 include_once(
"./Services/User/classes/class.ilUserUtil.php");
175 include_once(
"./Services/User/classes/class.ilUserUtil.php");
176 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionTable.php");
178 foreach(array_unique($users) as $idx => $user_id)
182 if($user_id != $ilUser->getId() && $ilAccess->checkAccessOfUser($user_id,
'read',
'',
$_GET[
'ref_id']))
186 $ulng->loadLanguageModule(
'dcl');
188 $subject = sprintf($ulng->txt(
'dcl_change_notification_subject'), $obj_dcl->getTitle());
191 $message .= $ulng->txt(
'dcl_change_notification_dcl_'.$a_action).
":\n\n";
192 $message .= $ulng->txt(
'obj_dcl').
": ".$obj_dcl->getTitle().
"\n\n";
193 $message .= $ulng->txt(
'dcl_table').
": ".$obj_table->getTitle().
"\n\n";
194 $message .= $ulng->txt(
'dcl_record').
":\n";
195 $message .=
"------------------------------------\n";
199 if(!$record->getTableId())
200 $record->setTableId($a_table_id);
203 foreach($record->getTable()->getVisibleFields() as $field){
204 if($record->getRecordField($field->getId())){
205 $t .= $field->getTitle().
": ".$record->getRecordField($field->getId())->getPlainText().
"\n";
210 $message .=
"------------------------------------\n";
212 $message .= $ulng->txt(
'dcl_change_notification_link').
": ".$link.
"\n\n";
214 $message .= $ulng->txt(
'dcl_change_why_you_receive_this_email');
216 $mail_obj =
new ilMail(ANONYMOUS_USER_ID);
217 $mail_obj->appendInstallationSignature(
true);
232 $this->main_table_id = $a_val;
240 return $this->main_table_id;
272 $this->
setOnline($original->getOnline());
274 $this->
setRating($original->getRating());
279 $table->doDelete(
true);
283 foreach($original->getTables() as $table)
286 $new_table->setObjId($this->
getId());
287 $new_table->cloneStructure($table->getId());
289 if($table->getId() == $original->getMainTableId())
299 foreach ($original->getTables() as $origTable) {
300 foreach ($origTable->getRecordFields() as $origField) {
309 $newRefId = $field->getId();
328 $this->is_online = $a_val;
336 return $this->is_online;
344 $this->rating = $a_val;
352 return $this->rating;
360 $this->public_notes = $a_val;
368 return $this->public_notes;
376 $this->approval = $a_val;
384 return $this->approval;
392 $this->notification = $a_val;
400 return $this->notification;
421 if($ilAccess->checkAccess(
"add_entry",
"", array_shift($references)))
437 return $ilAccess->checkAccess(
"write",
"", $ref);
448 return $ilAccess->checkAccess(
"add_entry",
"", $ref);
476 $query =
"SELECT id FROM il_dcl_table WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
477 $set = $ilDB->query(
$query);
480 while($rec = $ilDB->fetchAssoc($set))
491 if($table->getIsVisible())
492 $tables[$table->getId()] = $table;
505 $result = $ilDB->query(
'SELECT * FROM il_dcl_table WHERE obj_id = ' . $ilDB->quote($obj_id,
'integer') .
' AND title = ' . $ilDB->quote(
$title,
'text'));
506 return ($ilDB->numRows(
$result)) ?
true :
false;