4 require_once(
'Services/OrgUnit/classes/class.ilOrgUnitAssignment.php');
31 $query =
"SELECT * FROM org_unit_assignments WHERE oa_ou_id = %s";
33 $res = $ilDB->queryF(
$query, array(
'integer'), array($this->org_unit_id));
35 $this->assignments = array();
41 $assignment->setReportingAccess(
$row->oa_reporting_access);
42 $assignment->setCcComplianceInvitation(
$row->oa_cc_compl_invit);
43 $assignment->setCcComplianceNotify1(
$row->oa_cc_compl_not1);
44 $assignment->setCcComplianceNotify2(
$row->oa_cc_compl_not2);
46 $this->assignments[
$row->oa_usr_id] = $assignment;
49 #usort($this->assignments, array($this, 'sortCallback'));
57 $user_name_a = $user_a->getLastName().
', '.$user_a->getFirstName();
58 $user_name_b = $user_b->getLastName().
', '.$user_b->getFirstName();
60 return strcmp($user_name_a, $user_name_b);
64 $a_cc_compl_invit, $a_cc_compl_not1, $a_cc_compl_not2)
66 if( isset($this->assignments[$user_id]) )
67 throw new ilOrgUnitException(
'Error: User with id "'.$user_id.
'" is allready assigned!');
71 $assignment ->setReportingAccess($a_reporting_access)
72 ->setCcComplianceInvitation($a_cc_compl_invit)
73 ->setCcComplianceNotify1($a_cc_compl_not1)
74 ->setCcComplianceNotify2($a_cc_compl_not2)
77 $this->assignments[$user_id] = $assignment;
82 if( !isset($this->assignments[$user_id]) )
85 $this->assignments[$user_id]->delete();
87 unset( $this->assignments[$user_id] );
92 return isset($this->assignments[$a_user_id]);
97 return $this->assignments[$a_user_id]->hasReportingAccess();
102 return current($this->assignments);
107 return next($this->assignments);
112 return key($this->assignments);
117 return key($this->assignments) !== null;
122 return reset($this->assignments);