28 $result =
$ilDB->query(
"SELECT * FROM il_dcl_data WHERE id = " .
$ilDB->quote($this->getId(),
"integer"));
39 protected function doCreate($clone_mode =
false)
50 $main_table->setObjId($this->
getId());
51 $main_table->setTitle($this->
getTitle());
52 $main_table->setAddPerm(1);
53 $main_table->setEditPerm(1);
54 $main_table->setDeletePerm(0);
55 $main_table->setDeleteByOwner(1);
56 $main_table->setEditByOwner(1);
57 $main_table->setLimited(0);
58 $main_table->setIsVisible(
true);
59 $main_table->doCreate();
65 "id" => array(
"integer", $this->
getId()),
66 "is_online" => array(
"integer", (
int) $this->
getOnline()),
67 "rating" => array(
"integer", (
int) $this->
getRating()),
69 "approval" => array(
"integer", (
int) $this->
getApproval()),
91 $table->doDelete(
false,
true);
94 $query =
"DELETE FROM il_dcl_data WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
102 $ilDB = $DIC[
'ilDB'];
107 "id" => array(
"integer", $this->
getId()),
108 "is_online" => array(
"integer", (
int) $this->
getOnline()),
109 "rating" => array(
"integer", (
int) $this->
getRating()),
110 "public_notes" => array(
"integer", (
int) $this->
getPublicNotes()),
111 "approval" => array(
"integer", (
int) $this->
getApproval()),
115 "id" => array(
"integer", $this->
getId()),
126 public static function sendNotification($a_action, $a_table_id, $a_record_id = null)
130 $ilAccess = $DIC[
'ilAccess'];
133 if (
$_GET[
'ref_id'] == SYSTEM_FOLDER_ID) {
139 if ($dclObj->getNotification() != 1) {
143 $obj_dcl = $obj_table->getCollectionObject();
160 foreach (array_unique(
$users) as $idx => $user_id) {
164 $ilDclTable =
new ilDclTable($record->getTableId());
165 if ($user_id !=
$ilUser->getId() && $ilDclTable->hasPermissionToViewRecord(filter_input(INPUT_GET,
'ref_id'), $record, $user_id)) {
168 $ulng->loadLanguageModule(
'dcl');
170 $subject = sprintf($ulng->txt(
'dcl_change_notification_subject'), $obj_dcl->getTitle());
173 $message .= $ulng->txt(
'dcl_change_notification_dcl_' . $a_action) .
":\n\n";
174 $message .= $ulng->txt(
'obj_dcl') .
": " . $obj_dcl->getTitle() .
"\n\n";
175 $message .= $ulng->txt(
'dcl_table') .
": " . $obj_table->getTitle() .
"\n\n";
176 $message .= $ulng->txt(
'dcl_record') .
":\n";
177 $message .=
"------------------------------------\n";
179 if (!$record->getTableId()) {
180 $record->setTableId($a_table_id);
184 if ($tableview_id = $record->getTable()->getFirstTableViewId(
$_GET[
'ref_id'], $user_id)) {
185 $visible_fields = ilDclTableView::find($tableview_id)->getVisibleFields();
186 if (empty($visible_fields)) {
190 foreach ($visible_fields as $field) {
191 if ($field->isStandardField()) {
192 $value = $record->getStandardFieldPlainText($field->getId());
193 } elseif ($record_field = $record->getRecordField($field->getId())) {
194 $value = $record_field->getPlainText();
198 $t .= $field->getTitle() .
": " . $value .
"\n";
204 $message .=
"------------------------------------\n";
207 $message .= $ulng->txt(
'dcl_change_notification_link') .
": " . $link .
"\n\n";
209 $message .= $ulng->txt(
'dcl_change_why_you_receive_this_email');
211 $mail_obj =
new ilMail(ANONYMOUS_USER_ID);
212 $mail_obj->appendInstallationSignature(
true);
227 public function getFirstVisibleTableId()
231 $ilDB = $DIC[
'ilDB'];
237 WHERE obj_id = ' .
$ilDB->quote($this->getId(),
'integer') .
239 ORDER BY -table_order DESC ' 244 if (!
$result->numRows() && $only_visible) {
249 WHERE obj_id = ' .
$ilDB->quote($this->getId(),
'integer') .
' 250 ORDER BY -table_order DESC ' 265 foreach ($table_order as
$title) {
285 public function doCloneObject($new_obj, $a_target_id, $a_copy_id = null, $a_omit_tree =
false)
291 if (!$cp_options->isRootNode($this->getRefId())) {
295 $new_obj->cloneStructure($this->
getRefId());
343 $this->
setRating($original->getRating());
351 foreach ($original->getTables() as
$table) {
353 $new_table->setObjId($this->
getId());
354 $new_table->cloneStructure(
$table);
361 $table->afterClone();
371 $this->is_online = $a_val;
380 return $this->is_online;
389 $this->rating = $a_val;
398 return $this->rating;
407 $this->public_notes = $a_val;
416 return $this->public_notes;
425 $this->approval = $a_val;
434 return $this->approval;
452 return $this->notification;
486 $ilDB = $DIC[
'ilDB'];
488 $query =
"SELECT id FROM il_dcl_table WHERE obj_id = " .
$ilDB->quote($this->
getId(),
"integer") .
489 " ORDER BY -table_order DESC";
493 while ($rec =
$ilDB->fetchAssoc($set)) {
514 if ($table->getIsVisible() && $table->getVisibleTableViews($this->ref_id)) {
515 $tables[$table->getId()] =
$table;
534 $ilDB = $DIC[
'ilDB'];
536 'SELECT * FROM il_dcl_table WHERE obj_id = ' .
$ilDB->quote($obj_id,
'integer') .
' AND title = ' static _lookupLogin($a_user_id)
lookup login
const TYPE_DATACOLLECTION
static setCloneOf($old, $new, $type)
static _getTableIdByTitle($title, $obj_id)
doCreate($clone_mode=false)
reorderTables($table_order)
setPublicNotes($a_val)
setPublicNotes
static hasReadAccess($ref, $user_id=0)
static _lookupFullname($a_user_id)
Lookup Full Name.
static updateNotificationTime($type, $id, array $user_ids, $page_id=false)
Update the last mail timestamp for given object and users.
doCloneObject($new_obj, $a_target_id, $a_copy_id=null, $a_omit_tree=false)
Clone DCL.
static getTableCache($table_id=0)
Class ilDclBaseFieldModel.
static getNotificationsForObject($type, $id, $page_id=null, $ignore_threshold=false)
Get all users for given object.
getNotification()
getNotification
const TYPE_DATA_COLLECTION
static _hasReadAccess($ref)
catch(Exception $e) $message
static _getInstance($a_copy_id)
Get instance of copy wizard options.
static hasWriteAccess($ref, $user_id=0)
static getRecordCache($record_id=0)
static _hasTableByTitle($title, $obj_id)
Checks if a DataCollection has a table with a given title.
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, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
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...
setApproval($a_val)
setApproval
setOnline($a_val)
setOnline
setRating($a_val)
setRating
if(empty($password)) $table
Class ilObjDataCollection.
static _hasWriteAccess($ref)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
setNotification($a_val)
setNotification