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);
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())
300 foreach ($original->getTables() as $origTable) {
301 foreach ($origTable->getRecordFields() as $origField) {
310 $newRefId = $field->getId();
329 $this->is_online = $a_val;
337 return $this->is_online;
345 $this->rating = $a_val;
353 return $this->rating;
361 $this->public_notes = $a_val;
369 return $this->public_notes;
377 $this->approval = $a_val;
385 return $this->approval;
393 $this->notification = $a_val;
401 return $this->notification;
422 if($ilAccess->checkAccess(
"add_entry",
"", array_shift($references)))
438 return $ilAccess->checkAccess(
"write",
"", $ref);
449 return $ilAccess->checkAccess(
"add_entry",
"", $ref);
477 $query =
"SELECT id FROM il_dcl_table WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
478 $set = $ilDB->query(
$query);
481 while($rec = $ilDB->fetchAssoc($set))
492 if($table->getIsVisible())
493 $tables[$table->getId()] = $table;
506 $result = $ilDB->query(
'SELECT * FROM il_dcl_table WHERE obj_id = ' . $ilDB->quote($obj_id,
'integer') .
' AND title = ' . $ilDB->quote(
$title,
'text'));
507 return ($ilDB->numRows(
$result)) ?
true :
false;