53 $query =
"SELECT * FROM usr_starting_point WHERE id = " . $ilDB->quote($a_id,
'integer');
56 while ($point = $ilDB->fetchAssoc(
$res)) {
73 $this->starting_point = $a_starting_point;
95 $this->starting_object = $a_starting_object;
117 $this->starting_position = $a_starting_position;
139 $this->rule_type = $a_rule_type;
161 $this->rule_options = $a_rule_options;
184 $query =
"SELECT * FROM usr_starting_point";
187 while ($point = $ilDB->fetchAssoc(
$res)) {
189 "id" => $point[
"id"],
190 "position" => $point[
"position"],
191 "starting_point" => $point[
'starting_point'],
192 "starting_object" => $point[
'starting_object'],
193 "rule_type" => $point[
'rule_type'],
194 "rule_options" => $point[
'rule_options']
209 $query =
"SELECT * FROM usr_starting_point WHERE rule_options LIKE %s";
213 while ($sp = $ilDB->fetchAssoc(
$res)) {
214 $options = unserialize($sp[
'rule_options']);
218 "starting_point" => $sp[
'starting_point'],
219 "starting_object" => $sp[
'starting_object'],
220 "position" => $sp[
'position'],
221 "role_id" => $options[
'role_id'],
236 require_once
"./Services/AccessControl/classes/class.ilObjRole.php";
238 $global_roles = $rbacreview->getGlobalRoles();
240 $roles_with_starting_point = self::getRolesWithStartingPoint();
242 $ids_roles_with_sp =
array();
243 foreach ($roles_with_starting_point as $role) {
244 array_push($ids_roles_with_sp, $role[
'role_id']);
247 $ids_roles_without_sp = array_diff($global_roles, $ids_roles_with_sp);
250 foreach ($ids_roles_without_sp as $roleid) {
253 "id" => $role_obj->getId(),
254 "title" => $role_obj->getTitle(),
270 $position = $max_position + 10;
272 $next_id = $ilDB->nextId(
'usr_starting_point');
283 "INSERT INTO usr_starting_point (id, starting_point, starting_object, position, rule_type, rule_options) VALUES (%s, %s, %s, %s, %s, %s)",
284 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'text'),
297 'UPDATE usr_starting_point 298 SET starting_point = %s, 299 starting_object = %s, 304 array(
'integer',
'integer',
'integer',
'integer',
'text',
'integer'),
313 public function delete()
317 $query =
"DELETE FROM usr_starting_point WHERE id = " . $ilDB->quote($this->
id,
"integer");
318 $ilDB->manipulate(
$query);
331 $result = $ilDB->query(
"SELECT max(position) as max_order FROM usr_starting_point");
334 $order_val = (int)
$row[
'max_order'];
347 foreach ($a_items as $k => $v) {
350 $item[
'starting_position'] = $ord_const;
352 $a_items[$ord_const] = $item;
353 $ord_const = $ord_const + 10;
370 foreach ($a_items as
$id => $position) {
371 if ($position > self::ORDER_POSITION_MIN && $position < self::ORDER_POSITION_MAX) {
373 "UPDATE usr_starting_point SET" .
374 " position = " . $ilDB->quote($nr,
'integer') .
375 " WHERE id = " . $ilDB->quote(
$id,
'integer')
setRuleOptions($a_rule_options)
Sets rule type options.
setStartingObject($a_starting_object)
Sets the starting object.
static getStartingPoints()
Get all the starting points in database.
setData($a_id)
Set data for the starting point.
update()
update starting point
save()
insert starting point into database
getRuleOptions()
Gets the rule options.
static getRolesWithStartingPoint()
get array with all roles which have starting point defined.
static getGlobalRolesWithoutStartingPoint()
Get id and title of the roles without starting points.
getStartingObject()
Gets the starting object.
getPosition()
Gets the starting point position.
foreach($_POST as $key=> $value) $res
setPosition($a_starting_position)
Sets the starting position.
const USER_SELECTION_RULE
setStartingPoint($a_starting_point)
Sets the starting point.
saveOrder($a_items)
Save all starting point positions.
Create styles array
The data for the language used.
getRuleType()
Gets the rule type.
__construct($a_id=0)
Constructor.
static reArrangePositions($a_items)
getStartingPoint()
Gets the starting point.
setRuleType($a_rule_type)
Sets rule type.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options