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())
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;
409 return self::_checkAccess($this->
getId());
420 $references = self::_getAllReferences($data_collection_id);
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;
static getRecordCache($record_id=0)
doCloneObject(ilObjDataCollection $new_obj, $a_target_id, $a_copy_id=0)
Clone DCL.
setMainTableId($a_val)
set main Table Id
setPublicNotes($a_val)
setPublicNotes
static _checkAccess($data_collection_id)
fetchObject($a_set)
Fetch row as object from result set.
getMainTableId()
get main Table Id
static updateNotificationTime($type, $id, array $user_ids, $page_id=false)
Update the last mail timestamp for given object and users.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
_lookupFullname($a_user_id)
Lookup Full Name.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true)
Default behaviour is:
getNotification()
getNotification
const TYPE_DATA_COLLECTION
static _hasReadAccess($ref)
hasPermissionToAddTable()
static getFieldCache($field_id=0)
static _getFieldIdByTitle($title, $table_id)
Class Mail this class handles base functions for mail handling.
_lookupLogin($a_user_id)
lookup login
static _hasTableByTitle($title, $obj_id)
Checks if a DataCollection has a table with a given title.
getPublicNotes()
getPublicNotes
static _getLanguageOfUser($a_usr_id)
Get language object of user.
cloneStructure($original_id)
Attention only use this for objects who have not yet been created (use like: $x = new ilObjDataCollec...
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
setApproval($a_val)
setApproval
setOnline($a_val)
setOnline
setRating($a_val)
setRating
static sendNotification($a_action, $a_table_id, $a_record_id=NULL)
Class ilObject2 This is an intermediate progress of ilObject class.
static _getTableIdByTitle($title, $obj_id)
Class ilObjDataCollection.
const INPUTFORMAT_REFERENCE
static _hasWriteAccess($ref)
static getTableCache($table_id=0)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
setNotification($a_val)
setNotification
const PROPERTYID_REFERENCE