29 $result =
$ilDB->query(
"SELECT * FROM il_dcl_data WHERE id = " .
$ilDB->quote($this->getId(),
"integer"));
40 protected function doCreate($clone_mode =
false)
51 $main_table->setObjId($this->
getId());
52 $main_table->setTitle($this->
getTitle());
53 $main_table->setAddPerm(1);
54 $main_table->setEditPerm(1);
55 $main_table->setDeletePerm(0);
56 $main_table->setDeleteByOwner(1);
57 $main_table->setEditByOwner(1);
58 $main_table->setLimited(0);
59 $main_table->setIsVisible(
true);
60 $main_table->doCreate();
90 $table->doDelete(
false,
true);
93 $query =
"DELETE FROM il_dcl_data WHERE id = " .
$ilDB->quote($this->
getId(),
"integer");
101 $ilDB = $DIC[
'ilDB'];
121 public static function sendNotification($a_action, $a_table_id, $a_record_id = null)
125 $ilAccess = $DIC[
'ilAccess'];
128 if (
$_GET[
'ref_id'] == SYSTEM_FOLDER_ID) {
134 if ($dclObj->getNotification() != 1) {
138 $obj_dcl = $obj_table->getCollectionObject();
155 foreach (array_unique(
$users) as $idx => $user_id) {
159 $ilDclTable =
new ilDclTable($record->getTableId());
160 if ($user_id !=
$ilUser->getId() && $ilDclTable->hasPermissionToViewRecord(filter_input(INPUT_GET,
'ref_id'), $record, $user_id)) {
163 $ulng->loadLanguageModule(
'dcl');
165 $subject = sprintf($ulng->txt(
'dcl_change_notification_subject'), $obj_dcl->getTitle());
168 $message .= $ulng->txt(
'dcl_change_notification_dcl_' . $a_action) .
":\n\n";
169 $message .= $ulng->txt(
'obj_dcl') .
": " . $obj_dcl->getTitle() .
"\n\n";
170 $message .= $ulng->txt(
'dcl_table') .
": " . $obj_table->getTitle() .
"\n\n";
171 $message .= $ulng->txt(
'dcl_record') .
":\n";
172 $message .=
"------------------------------------\n";
174 if (!$record->getTableId()) {
175 $record->setTableId($a_table_id);
179 if ($tableview_id = $record->getTable()->getFirstTableViewId(
$_GET[
'ref_id'], $user_id)) {
180 $visible_fields = ilDclTableView::find($tableview_id)->getVisibleFields();
181 if (empty($visible_fields)) {
185 foreach ($visible_fields as $field) {
186 if ($field->isStandardField()) {
187 $value = $record->getStandardFieldPlainText($field->getId());
188 } elseif ($record_field = $record->getRecordField($field->getId())) {
189 $value = $record_field->getPlainText();
193 $t .= $field->getTitle() .
": " . $value .
"\n";
199 $message .=
"------------------------------------\n";
202 $message .= $ulng->txt(
'dcl_change_notification_link') .
": " . $link .
"\n\n";
204 $message .= $ulng->txt(
'dcl_change_why_you_receive_this_email');
206 $mail_obj =
new ilMail(ANONYMOUS_USER_ID);
207 $mail_obj->appendInstallationSignature(
true);
221 public function getFirstVisibleTableId()
225 $ilDB = $DIC[
'ilDB'];
230 WHERE obj_id = ' .
$ilDB->quote($this->getId(),
'integer') .
232 ORDER BY -table_order DESC ');
236 if (!
$result->numRows() && $only_visible) {
240 WHERE obj_id = ' .
$ilDB->quote($this->getId(),
'integer') .
' 241 ORDER BY -table_order DESC ');
253 foreach ($table_order as
$title) {
273 public function doCloneObject($new_obj, $a_target_id, $a_copy_id = null, $a_omit_tree =
false)
279 if (!$cp_options->isRootNode($this->getRefId())) {
283 $new_obj->cloneStructure($this->
getRefId());
331 $this->
setRating($original->getRating());
339 foreach ($original->getTables() as
$table) {
341 $new_table->setObjId($this->
getId());
342 $new_table->cloneStructure(
$table);
349 $table->afterClone();
359 $this->is_online = $a_val;
368 return $this->is_online;
377 $this->rating = $a_val;
386 return $this->rating;
395 $this->public_notes = $a_val;
404 return $this->public_notes;
413 $this->approval = $a_val;
422 return $this->approval;
440 return $this->notification;
474 $ilDB = $DIC[
'ilDB'];
476 $query =
"SELECT id FROM il_dcl_table WHERE obj_id = " .
$ilDB->quote($this->
getId(),
"integer") .
477 " ORDER BY -table_order DESC";
481 while ($rec =
$ilDB->fetchAssoc($set)) {
500 if ($table->getIsVisible() && $table->getVisibleTableViews($this->ref_id)) {
501 $tables[$table->getId()] =
$table;
520 $ilDB = $DIC[
'ilDB'];
521 $result =
$ilDB->query(
'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.
This class handles base functions for mail handling.
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
Create styles array
The data for the language used.
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
Class ilObject2 This is an intermediate progress of ilObject class.
if(empty($password)) $table
Class ilObjDataCollection.
static _hasWriteAccess($ref)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
setNotification($a_val)
setNotification