ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilSCTask.php
Go to the documentation of this file.
1
<?
php
2
3
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
include_once
'./Services/Calendar/classes/class.ilDateTime.php'
;
6
12
class
ilSCTask
13
{
14
const
STATUS_NOT_ATTEMPTED
= 0;
15
const
STATUS_IN_PROGRESS
= 1;
16
const
STATUS_COMPLETED
= 2;
17
const
STATUS_FAILED
= 3;
18
19
20
21
private
$id
= 0;
22
private
$grp_id
= 0;
23
private
$last_update
= null;
24
private
$status
= 0;
25
private
$identifier
=
''
;
26
27
32
public
function
__construct
($a_id = 0)
33
{
34
$this->
id
= $a_id;
35
$this->
read
();
36
}
37
38
public
function
getId
()
39
{
40
return
$this->id
;
41
}
42
43
public
function
setGroupId
($a_id)
44
{
45
$this->grp_id = $a_id;
46
}
47
48
public
function
getGroupId
()
49
{
50
return
$this->grp_id
;
51
}
52
53
public
function
setIdentifier
($a_ide)
54
{
55
$this->identifier = $a_ide;
56
}
57
58
public
function
getIdentifier
()
59
{
60
return
$this->identifier
;
61
}
62
63
64
public
function
setLastUpdate
(
ilDateTime
$a_update)
65
{
66
$this->last_update = $a_update;
67
}
68
73
public
function
getLastUpdate
()
74
{
75
if
(!$this->last_update) {
76
return
$this->last_update =
new
ilDateTime
();
77
}
78
return
$this->last_update
;
79
}
80
81
public
function
setStatus
($a_status)
82
{
83
$this->status = $a_status;
84
}
85
90
public
function
getStatus
()
91
{
92
return
$this->status
;
93
}
94
98
public
function
isActive
()
99
{
100
return
true
;
101
}
102
106
public
function
read
()
107
{
108
global
$DIC
;
109
110
$ilDB
= $DIC[
'ilDB'
];
111
112
if
(!$this->
getId
()) {
113
return
false
;
114
}
115
116
$query
=
'SELECT * FROM sysc_tasks '
.
117
'WHERE id = '
.
$ilDB
->quote($this->
getId
(),
'integer'
);
118
$res
=
$ilDB
->query(
$query
);
119
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
120
$this->
setGroupId
(
$row
->grp_id);
121
$this->
setLastUpdate
(
new
ilDateTime
(
$row
->last_update,
IL_CAL_DATETIME
,
ilTimeZone::UTC
));
122
$this->
setStatus
(
$row
->status);
123
$this->
setIdentifier
(
$row
->identifier);
124
}
125
return
true
;
126
}
127
131
public
function
create
()
132
{
133
global
$DIC
;
134
135
$ilDB
= $DIC[
'ilDB'
];
136
137
$this->
id
=
$ilDB
->nextId(
'sysc_tasks'
);
138
139
$query
=
'INSERT INTO sysc_tasks (id,grp_id,status,identifier) '
.
140
'VALUES ( '
.
141
$ilDB
->quote($this->
getId
(),
'integer'
) .
', '
.
142
$ilDB
->quote($this->
getGroupId
(),
'integer'
) .
', '
.
143
$ilDB
->quote($this->
getStatus
(),
'integer'
) .
', '
.
144
$ilDB
->quote($this->
getIdentifier
(),
'text'
) .
' '
.
145
')'
;
146
$ilDB
->manipulate(
$query
);
147
return
$this->
getId
();
148
}
149
153
public
function
update
()
154
{
155
global
$DIC
;
156
157
$ilDB
= $DIC[
'ilDB'
];
158
159
$query
=
'UPDATE sysc_tasks SET '
.
160
'last_update = '
.
$ilDB
->quote($this->
getLastUpdate
()->
get
(
IL_CAL_DATETIME
,
''
,
ilTimeZone::UTC
),
'timestamp'
) .
', '
.
161
'status = '
.
$ilDB
->quote($this->
getStatus
(),
'integer'
) .
', '
.
162
'identifier = '
.
$ilDB
->quote($this->
getIdentifier
(),
'text'
) .
' '
.
163
'WHERE id = '
.
$ilDB
->quote($this->
getId
(),
'integer'
);
164
$ilDB
->manipulate(
$query
);
165
}
166
}
ilSCTask\getGroupId
getGroupId()
Definition:
class.ilSCTask.php:48
ilSCTask
Defines a system check task.
Definition:
class.ilSCTask.php:12
ilSCTask\__construct
__construct($a_id=0)
Constructor.
Definition:
class.ilSCTask.php:32
ilSCTask\setStatus
setStatus($a_status)
Definition:
class.ilSCTask.php:81
IL_CAL_DATETIME
const IL_CAL_DATETIME
Definition:
class.ilDateTime.php:9
ilSCTask\isActive
isActive()
Definition:
class.ilSCTask.php:98
$DIC
global $DIC
Definition:
saml.php:7
ilSCTask\STATUS_FAILED
const STATUS_FAILED
Definition:
class.ilSCTask.php:17
ilTimeZone\UTC
const UTC
Definition:
class.ilTimeZone.php:45
ilSCTask\setIdentifier
setIdentifier($a_ide)
Definition:
class.ilSCTask.php:53
ilSCTask\getStatus
getStatus()
Get status.
Definition:
class.ilSCTask.php:90
ilSCTask\$status
$status
Definition:
class.ilSCTask.php:24
ilSCTask\$identifier
$identifier
Definition:
class.ilSCTask.php:25
ilSCTask\getIdentifier
getIdentifier()
Definition:
class.ilSCTask.php:58
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilSCTask\create
create()
Create new group.
Definition:
class.ilSCTask.php:131
ilSCTask\$grp_id
$grp_id
Definition:
class.ilSCTask.php:22
ilDateTime
Date and time handling
Definition:
class.ilDateTime.php:33
ilSCTask\update
update()
Update task.
Definition:
class.ilSCTask.php:153
$query
$query
Definition:
proxy_ylocal.php:13
ilSCTask\$id
$id
Definition:
class.ilSCTask.php:21
ilSCTask\STATUS_IN_PROGRESS
const STATUS_IN_PROGRESS
Definition:
class.ilSCTask.php:15
$row
$row
Definition:
migrateto20.php:360
ilSCTask\STATUS_COMPLETED
const STATUS_COMPLETED
Definition:
class.ilSCTask.php:16
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilSCTask\getId
getId()
Definition:
class.ilSCTask.php:38
ilSCTask\read
read()
Read group.
Definition:
class.ilSCTask.php:106
ilSCTask\getLastUpdate
getLastUpdate()
Get last update date.
Definition:
class.ilSCTask.php:73
ilSCTask\STATUS_NOT_ATTEMPTED
const STATUS_NOT_ATTEMPTED
Definition:
class.ilSCTask.php:14
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilSCTask\setLastUpdate
setLastUpdate(ilDateTime $a_update)
Definition:
class.ilSCTask.php:64
ilSCTask\setGroupId
setGroupId($a_id)
Definition:
class.ilSCTask.php:43
ilSCTask\$last_update
$last_update
Definition:
class.ilSCTask.php:23
Services
SystemCheck
classes
class.ilSCTask.php
Generated on Thu Jan 30 2025 19:02:05 for ILIAS by
1.8.13 (using
Doxyfile
)