ILIAS  release_4-4 Revision
ilObjiLincCourse Class Reference

Class ilObjiLincCourse. More...

+ Inheritance diagram for ilObjiLincCourse:
+ Collaboration diagram for ilObjiLincCourse:

Public Member Functions

 ilObjiLincCourse ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 getViewMode ()
 
 read ()
 private More...
 
 getiLincId ()
 
 getErrorMsg ()
 
 getAKClassValue1 ()
 
 getAKClassValue2 ()
 
 setAKClassValue1 ($a_str)
 
 setAKClassValue2 ($a_str)
 
 update ()
 update object data More...
 
 addCourse ()
 create course on iLinc server More...
 
 delete ()
 delete object and all related data More...
 
 storeiLincId ($a_icrs_id)
 
 saveActivationStatus ($a_activated)
 
 saveAKClassValues ($a_akclassvalue1, $a_akclassvalue2)
 
 initDefaultRoles ()
 init default roles settings More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event happend, each object may decide how it reacts. More...
 
 addMember (&$a_user_obj, $a_mem_role, $a_instructor=false)
 add Member to iLic course public More...
 
 join ($a_user_id, $a_mem_role="")
 join icrs, assigns user to role private More...
 
 leave ($a_user_id)
 deassign member from group role private More...
 
 getMemberRoles ($a_user_id)
 get group member status public More...
 
 getMemberIds ()
 get all group Member ids regardless of role public More...
 
 getMemberData ($a_mem_ids, $active=1)
 get all group Members regardless of group role. More...
 
 getLocalRoles ($a_translate=false)
 get ALL local roles of group, also those created and defined afterwards only fetch data once from database. More...
 
 getMemberRolesTitle ($a_user_id)
 get group member status public More...
 
 getDefaultMemberRole ()
 returns object id of created default member role public More...
 
 getDefaultAdminRole ()
 returns object id of created default adminstrator role public More...
 
 getClassrooms ()
 
 updateClassrooms ()
 
 userExists (&$a_user_obj)
 
 addUser (&$a_user_obj)
 
 isMember ($a_user_id="")
 
 isDocent ($a_user_obj="")
 
 registerUser (&$a_user_obj, $a_instructor=false)
 
 registerUsers ($a_user_arr)
 
 unregisterUser ($a_user_obj)
 
 unregisterUsers ($a_ilinc_user_ids)
 
 userLogin (&$a_user_obj)
 
 uploadPicture (&$a_user_obj, $a_lang)
 
 getAdminIds ($a_grpId="")
 get Group Admin Id public More...
 
 removeMember (&$a_user_obj)
 removes Member from group public More...
 
 isAdmin ($a_user_id)
 is Admin public More...
 
 getDefaultRoles ($a_grp_id="")
 get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public More...
 
 getiLincMemberIds ($a_instructorflag=false)
 
 checkiLincMemberStatus ($a_ilinc_user_id, $a_docent_ids, $a_student_ids)
 
 _isActivated ($a_course_obj_id)
 
 _getAKClassValues ($a_course_obj_id)
 
 _isMember ($a_user_id, $a_ref_id)
 checks wether the user relating to the passed usr_id is member of iLinc course with passed ref_id More...
 
 __setCourseStatus ()
 
 getSubItems ()
 get all subitems of the container overwrites method in ilContainerGUI More...
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 
- Public Member Functions inherited from ilContainer
 ilContainer ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 createContainerDirectory ()
 Create directory for the container. More...
 
 getContainerDirectory ()
 Get the container directory. More...
 
 _getContainerDirectory ($a_id)
 Get the container directory. More...
 
 getBigIconPath ()
 Get path for big icon. More...
 
 getSmallIconPath ()
 Get path for small icon. More...
 
 getTinyIconPath ()
 Get path for tiny icon. More...
 
 setHiddenFilesFound ($a_hiddenfilesfound)
 Set Found hidden files (set by getSubItems). More...
 
 getHiddenFilesFound ()
 Get Found hidden files (set by getSubItems). More...
 
 getStyleSheetId ()
 get ID of assigned style sheet object More...
 
 setStyleSheetId ($a_style_id)
 set ID of assigned style sheet object More...
 
 _lookupContainerSetting ($a_id, $a_keyword, $a_default_value=NULL)
 Lookup a container setting. More...
 
 _writeContainerSetting ($a_id, $a_keyword, $a_value)
 
 _lookupIconPath ($a_id, $a_size="big")
 lookup icon path More...
 
 saveIcons ($a_big_icon, $a_small_icon, $a_tiny_icon)
 save container icons More...
 
 removeBigIcon ()
 remove big icon More...
 
 removeSmallIcon ()
 remove small icon More...
 
 removeTinyIcon ()
 remove tiny icon More...
 
 cloneObject ($a_target_id, $a_copy_id=0)
 Clone container settings. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies (container sorting) More...
 
 cloneAllObject ($session_id, $client_id, $new_type, $ref_id, $clone_source, $options, $soap_call=false)
 clone all objects according to this container More...
 
 getViewMode ()
 Get container view mode. More...
 
 getOrderType ()
 Get order type default implementation. More...
 
 setOrderType ($a_value)
 
 getSubItems ($a_admin_panel_enabled=false, $a_include_side_block=false, $a_get_single=0)
 Get subitems of container. More...
 
 gotItems ()
 Check whether we got any items. More...
 
 addAdditionalSubItemInformation (&$object)
 Add additional information to sub item, e.g. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 enablePageEditing ()
 Check whether page editing is allowed for container. More...
 
 create ()
 Create. More...
 
 update ()
 Update. More...
 
 read ()
 read More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 
- Static Public Member Functions inherited from ilContainer
static getCompleteDescriptions (array $objects)
 overwrites description fields to long or short description in an assoc array keys needed (obj_id and description) More...
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 
- Data Fields inherited from ilContainer
const VIEW_SESSIONS = 0
 
const VIEW_OBJECTIVE = 1
 
const VIEW_TIMING = 2
 
const VIEW_ARCHIVE = 3
 
const VIEW_SIMPLE = 4
 
const VIEW_BY_TYPE = 5
 
const VIEW_INHERIT = 6
 
const VIEW_ILINC = 7
 
const VIEW_DEFAULT = self::VIEW_BY_TYPE
 
const SORT_TITLE = 0
 
const SORT_MANUAL = 1
 
const SORT_ACTIVATION = 2
 
const SORT_INHERIT = 3
 
- Static Public Attributes inherited from ilContainer
static $data_preloaded = false
 
- Protected Attributes inherited from ilContainer
 $order_type = 0
 
 $hiddenfilesfound = false
 

Detailed Description

Class ilObjiLincCourse.

Author
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
$Id$

Definition at line 37 of file class.ilObjiLincCourse.php.

Member Function Documentation

◆ __setCourseStatus()

ilObjiLincCourse::__setCourseStatus ( )

Definition at line 1258 of file class.ilObjiLincCourse.php.

Referenced by initDefaultRoles().

1259  {
1260  // empty
1261  }
+ Here is the caller graph for this function:

◆ _getAKClassValues()

ilObjiLincCourse::_getAKClassValues (   $a_course_obj_id)

Definition at line 1220 of file class.ilObjiLincCourse.php.

References ilObject\$ilias, $r, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjiLincClassroomGUI\getDefaultValues(), ilObjiLincClassroomGUI\getObjectValues(), ilObjiLincCourseListGUI\getProperties(), ilObjiLincClassroomGUI\save(), and ilObjiLincClassroomGUI\updateClassroom().

1221  {
1222  global $ilDB,$ilias;
1223 
1224  $r = $ilDB->queryf('
1225  SELECT akclassvalue1, akclassvalue2 FROM ilinc_data WHERE obj_id = %s',
1226  array('integer'), array($a_course_obj_id));
1227 
1228  $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
1229 
1230  return $akclassvalues = array($row->akclassvalue1,$row->akclassvalue2);
1231  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
$r
+ Here is the caller graph for this function:

◆ _isActivated()

ilObjiLincCourse::_isActivated (   $a_course_obj_id)

Definition at line 1202 of file class.ilObjiLincCourse.php.

References ilObject\$ilias, $r, $row, DB_FETCHMODE_OBJECT, and ilUtil\yn2tf().

Referenced by ilObjiLincCourseAccess\_checkAccess(), and ilObjiLincCourseListGUI\getProperties().

1203  {
1204  global $ilDB,$ilias;
1205 
1206  if (!$ilias->getSetting("ilinc_active"))
1207  {
1208  return false;
1209  }
1210 
1211  $r = $ilDB->queryf('
1212  SELECT activation_offline FROM ilinc_data WHERE obj_id = %s',
1213  array('integer'), array($a_course_obj_id));
1214 
1215  $row = $r->fetchRow(DB_FETCHMODE_OBJECT);
1216 
1217  return ilUtil::yn2tf($row->activation_offline);
1218  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
static yn2tf($a_yn)
convert "y"/"n" to true/false
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isMember()

ilObjiLincCourse::_isMember (   $a_user_id,
  $a_ref_id 
)

checks wether the user relating to the passed usr_id is member of iLinc course with passed ref_id

ilRbacReview $rbacreview

Parameters
integer$a_user_id
integer$a_ref_id
Returns
boolean

Definition at line 1242 of file class.ilObjiLincCourse.php.

Referenced by ilObjiLincCourseAccess\_checkAccess(), and ilObjiLincClassroomAccess\_checkAccess().

1243  {
1244  global $rbacreview;
1245 
1246  $rolf = $rbacreview->getRoleFolderOfObject($a_ref_id);
1247  $local_roles = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"],false);
1248  $user_roles = $rbacreview->assignedRoles($a_user_id);
1249 
1250  if (!array_intersect($local_roles,$user_roles))
1251  {
1252  return false;
1253  }
1254 
1255  return true;
1256  }
+ Here is the caller graph for this function:

◆ addCourse()

ilObjiLincCourse::addCourse ( )

create course on iLinc server

public

Returns
boolean

Definition at line 172 of file class.ilObjiLincCourse.php.

References $_POST.

173  {
174  $this->ilincAPI->addCourse($_POST["Fobject"]);
175  $response = $this->ilincAPI->sendRequest();
176 
177  if ($response->isError())
178  {
179  $this->error_msg = $response->getErrorMsg();
180  return false;
181  }
182 
183  $this->ilinc_id = $response->getFirstID();
184 
185  return true;
186  }
$_POST['username']
Definition: cron.php:12

◆ addMember()

ilObjiLincCourse::addMember ( $a_user_obj,
  $a_mem_role,
  $a_instructor = false 
)

add Member to iLic course public

Parameters
integeruser_id
integermember role_id of local group_role
booleanregister member on iLinc server as student(false) or docent(true)

Definition at line 369 of file class.ilObjiLincCourse.php.

References addUser(), join(), registerUser(), and userExists().

370  {
371  global $rbacadmin;
372 //echo "0";
373  if (!isset($a_user_obj) && !isset($a_mem_role))
374  {
375  $this->error_msg = get_class($this)."::addMember(): Missing parameters !";
376  return false;
377  }
378 //echo "1";
379  // check if user is registered at iLinc server
380  if (!$this->userExists($a_user_obj))
381  {
382  // if not, add user on iLinc server
383  if ($this->addUser($a_user_obj) == false)
384  {
385  // error_msg already set
386  return false;
387  }
388  }
389 //echo "2";
390  // assign membership to icourse on iLinc server
391  if (!$this->registerUser($a_user_obj,$a_instructor))
392  {
393  // error_msg already set
394  return false;
395  }
396 //echo "3";
397  // finally assign user to member role in ILIAS
398  $this->join($a_user_obj->getId(),$a_mem_role);
399 //echo "4";
400  return true;
401  }
registerUser(&$a_user_obj, $a_instructor=false)
join($a_user_id, $a_mem_role="")
join icrs, assigns user to role private
+ Here is the call graph for this function:

◆ addUser()

ilObjiLincCourse::addUser ( $a_user_obj)

Definition at line 799 of file class.ilObjiLincCourse.php.

Referenced by addMember().

800  {
801  include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
802  $ilinc_user = new ilObjiLincUser($a_user_obj);
803 
804  return $ilinc_user->add();
805  }
Class ilObjiLincUser iLinc related user settings.
+ Here is the caller graph for this function:

◆ checkiLincMemberStatus()

ilObjiLincCourse::checkiLincMemberStatus (   $a_ilinc_user_id,
  $a_docent_ids,
  $a_student_ids 
)

Definition at line 1187 of file class.ilObjiLincCourse.php.

1188  {
1189  if (in_array($a_ilinc_user_id,$a_docent_ids))
1190  {
1191  return ILINC_MEMBER_DOCENT;
1192  }
1193 
1194  if (in_array($a_ilinc_user_id,$a_student_ids))
1195  {
1196  return ILINC_MEMBER_STUDENT;
1197  }
1198 
1199  return ILINC_MEMBER_NOTSET;
1200  }

◆ delete()

ilObjiLincCourse::delete ( )

delete object and all related data

public

Returns
boolean true if all object data were removed; false if only a references were removed

Definition at line 195 of file class.ilObjiLincCourse.php.

References getiLincId().

196  {
197  global $ilDB;
198 
199  // always call parent delete function first!!
200  if (!parent::delete())
201  {
202  return false;
203  }
204 
205  //put here your module specific stuff
206  $statement = $ilDB->manipulateF('
207  DELETE FROM ilinc_data WHERE course_id = %s',
208  array('integer'), array($this->getiLincId()));
209 
210 
211  // TODO: delete data in ilinc_registration table
212  /*
213  * not tested yet
214  */
215 /* $statement = $ilDB->manipulateF('
216  DELETE FROM ilinc_registration
217  WHERE obj_id = %s',
218  array('integer'), array($this->getId()));
219 
220 */
221 
222  // remove course from ilinc server
223  $this->ilincAPI->removeCourse($this->getiLincId());
224  $response = $this->ilincAPI->sendRequest();
225 
226  return true;
227  }
+ Here is the call graph for this function:

◆ getAdminIds()

ilObjiLincCourse::getAdminIds (   $a_grpId = "")

get Group Admin Id public

Parameters
integergroup id
returnsuserids that are assigned to a group administrator! role

Definition at line 1023 of file class.ilObjiLincCourse.php.

References getDefaultRoles(), and ilObject\getRefId().

Referenced by removeMember().

1024  {
1025  global $rbacreview;
1026 
1027  if (!empty($a_grpId))
1028  {
1029  $grp_id = $a_grpId;
1030  }
1031  else
1032  {
1033  $grp_id = $this->getRefId();
1034  }
1035 
1036  $usr_arr = array();
1037  $roles = $this->getDefaultRoles($this->getRefId());
1038 
1039  foreach ($rbacreview->assignedUsers($this->getDefaultAdminRole()) as $member_id)
1040  {
1041  array_push($usr_arr,$member_id);
1042  }
1043 
1044  return $usr_arr;
1045  }
getDefaultRoles($a_grp_id="")
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public ...
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAKClassValue1()

ilObjiLincCourse::getAKClassValue1 ( )

Definition at line 105 of file class.ilObjiLincCourse.php.

Referenced by update().

106  {
107  return $this->akclassvalue1;
108  }
+ Here is the caller graph for this function:

◆ getAKClassValue2()

ilObjiLincCourse::getAKClassValue2 ( )

Definition at line 110 of file class.ilObjiLincCourse.php.

Referenced by update().

111  {
112  return $this->akclassvalue2;
113  }
+ Here is the caller graph for this function:

◆ getClassrooms()

ilObjiLincCourse::getClassrooms ( )

Definition at line 677 of file class.ilObjiLincCourse.php.

References $data, $ilErr, and getiLincId().

Referenced by getSubItems().

678  {
679  global $ilErr;
680 
681  if (!$this->ilias->getSetting("ilinc_active"))
682  {
683  $this->error_msg = "ilinc_server_not_active";
684  return false;
685  }
686 
687  $this->ilincAPI->findCourseClasses($this->getiLincId());
688  $response = $this->ilincAPI->sendRequest();
689 
690  if ($response->isError())
691  {
692  if (!$response->getErrorMsg())
693  {
694  $this->error_msg = "err_get_classrooms";
695  }
696  else
697  {
698  $this->error_msg = $response->getErrorMsg();
699  }
700 
701  return false;
702  }
703 
704  if (!$response->data['classes'])
705  {
706 
707  $this->error_msg = $response->data['result']['cdata'];
708  return false;
709  }
710 
711  foreach ($response->data['classes'] as $class_id => $data)
712  {
713  $this->ilincAPI->findClass($class_id);
714  $response = $this->ilincAPI->sendRequest("findClass");
715 
716  if ($response->data['classes'])
717  {
718  $full_class_data[$class_id] = $response->data['classes'][$class_id];
719  }
720  }
721 
722  return $full_class_data;
723  }
redirection script todo: (a better solution should control the processing via a xml file) ...
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultAdminRole()

ilObjiLincCourse::getDefaultAdminRole ( )

returns object id of created default adminstrator role public

Definition at line 670 of file class.ilObjiLincCourse.php.

References getLocalRoles().

671  {
672  $local_icrs_Roles = $this->getLocalRoles();
673 
674  return $local_icrs_Roles["il_icrs_admin_".$this->getRefId()];
675  }
getLocalRoles($a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
+ Here is the call graph for this function:

◆ getDefaultMemberRole()

ilObjiLincCourse::getDefaultMemberRole ( )

returns object id of created default member role public

Definition at line 659 of file class.ilObjiLincCourse.php.

References getLocalRoles().

660  {
661  $local_icrs_Roles = $this->getLocalRoles();
662 
663  return $local_icrs_Roles["il_icrs_member_".$this->getRefId()];
664  }
getLocalRoles($a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
+ Here is the call graph for this function:

◆ getDefaultRoles()

ilObjiLincCourse::getDefaultRoles (   $a_grp_id = "")

get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public

Parameters
returnsthe obj_ids of group specific roles(il_grp_member,il_grp_admin)

Definition at line 1112 of file class.ilObjiLincCourse.php.

References ilObject\getRefId().

Referenced by getAdminIds(), and isAdmin().

1113  {
1114  global $rbacadmin, $rbacreview;
1115 
1116  if (strlen($a_grp_id) > 0)
1117  {
1118  $grp_id = $a_grp_id;
1119  }
1120  else
1121  {
1122  $grp_id = $this->getRefId();
1123  }
1124 
1125  $rolf = $rbacreview->getRoleFolderOfObject($grp_id);
1126  $role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
1127 
1128  foreach ($role_arr as $role_id)
1129  {
1130  $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
1131 
1132  $grp_Member ="il_icrs_member_".$grp_id;
1133  $grp_Admin ="il_icrs_admin_".$grp_id;
1134 
1135  if (strcmp($role_Obj->getTitle(), $grp_Member) == 0 )
1136  {
1137  $arr_grpDefaultRoles["icrs_member_role"] = $role_Obj->getId();
1138  }
1139 
1140  if (strcmp($role_Obj->getTitle(), $grp_Admin) == 0)
1141  {
1142  $arr_grpDefaultRoles["icrs_admin_role"] = $role_Obj->getId();
1143  }
1144  }
1145 
1146  return $arr_grpDefaultRoles;
1147  }
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getErrorMsg()

ilObjiLincCourse::getErrorMsg ( )

Definition at line 97 of file class.ilObjiLincCourse.php.

98  {
99  $err_msg = $this->error_msg;
100  $this->error_msg = "";
101 
102  return $err_msg;
103  }

◆ getiLincId()

ilObjiLincCourse::getiLincId ( )

Definition at line 92 of file class.ilObjiLincCourse.php.

Referenced by delete(), getClassrooms(), getiLincMemberIds(), registerUser(), registerUsers(), unregisterUser(), unregisterUsers(), update(), and updateClassrooms().

93  {
94  return $this->ilinc_id;
95  }
+ Here is the caller graph for this function:

◆ getiLincMemberIds()

ilObjiLincCourse::getiLincMemberIds (   $a_instructorflag = false)

Definition at line 1150 of file class.ilObjiLincCourse.php.

References getiLincId().

Referenced by isDocent().

1151  {
1152  if ($a_instructorflag == true)
1153  {
1154  if (!empty($this->docent_ids))
1155  {
1156  return $this->docent_ids;
1157  }
1158  }
1159  else
1160  {
1161  if (!empty($this->student_ids))
1162  {
1163  return $this->student_ids;
1164  }
1165  }
1166 
1167  $this->ilincAPI->findRegisteredUsersByRole($this->getiLincId(),$a_instructorflag);
1168  $response = $this->ilincAPI->sendRequest();
1169 
1170  if (is_array($response->data['users']))
1171  {
1172  if ($a_instructorflag == true)
1173  {
1174  $this->docent_ids = array_keys($response->data['users']);
1175  }
1176  else
1177  {
1178  $this->student_ids = array_keys($response->data['users']);
1179  }
1180 
1181  return array_keys($response->data['users']);
1182  }
1183 
1184  return array();
1185  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocalRoles()

ilObjiLincCourse::getLocalRoles (   $a_translate = false)

get ALL local roles of group, also those created and defined afterwards only fetch data once from database.

info is stored in object variable public

Returns
return array [title|id] of roles...

Definition at line 562 of file class.ilObjiLincCourse.php.

References ilObjRole\_getTranslation(), and ilObject\getRefId().

Referenced by getDefaultAdminRole(), getDefaultMemberRole(), getMemberIds(), getMemberRoles(), and getMemberRolesTitle().

563  {
564  global $rbacadmin,$rbacreview;
565 
566  if (empty($this->local_roles))
567  {
568  $this->local_roles = array();
569  $rolf = $rbacreview->getRoleFolderOfObject($this->getRefId());
570  $role_arr = $rbacreview->getRolesOfRoleFolder($rolf["ref_id"]);
571 
572  foreach ($role_arr as $role_id)
573  {
574  if ($rbacreview->isAssignable($role_id,$rolf["ref_id"]) == true)
575  {
576  $role_Obj =& $this->ilias->obj_factory->getInstanceByObjId($role_id);
577 
578  if ($a_translate)
579  {
580  $role_name = ilObjRole::_getTranslation($role_Obj->getTitle());
581  }
582  else
583  {
584  $role_name = $role_Obj->getTitle();
585  }
586 
587  $this->local_roles[$role_name] = $role_Obj->getId();
588  }
589  }
590  }
591 
592  return $this->local_roles;
593  }
_getTranslation($a_role_title)
redirection script todo: (a better solution should control the processing via a xml file) ...
getRefId()
get reference id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMemberData()

ilObjiLincCourse::getMemberData (   $a_mem_ids,
  $active = 1 
)

get all group Members regardless of group role.

fetch all users data in one shot to improve performance public

Parameters
arrayof user ids
Returns
return array of userdata

Definition at line 503 of file class.ilObjiLincCourse.php.

References $ilBench, $in, $query, $r, and $row.

504  {
505  global $rbacadmin, $rbacreview, $ilBench, $ilDB;
506 
507  $usr_arr= array();
508 
509  $data_types = array();
510  $data_values = array();
511  $cnt_mem_ids = count($a_mem_ids);
512 
513  $query = 'SELECT login,firstname,lastname,title,usr_id,ilinc_id
514  FROM usr_data WHERE usr_id IN ';
515 
516  if (is_array($a_mem_ids) &&
517  $cnt_mem_ids > 0)
518  {
519  $in = '(';
520  $counter = 0;
521  foreach($a_mem_ids as $mem_id)
522  {
523  array_push($data_values, $mem_id);
524  array_push($data_types, 'integer');
525 
526  if($counter > 0) $in .= ',';
527  $in .= '%s';
528  ++$counter;
529  }
530  $in .= ')';
531  $query .= $in;
532  }
533 
534  if (is_numeric($active) && $active > -1)
535  {
536  $query .= ' AND active = %s';
537  array_push($data_values,$active);
538  array_push($data_types, 'integer');
539  }
540 
541  $r = $ilDB->queryf($query, $data_types, $data_values);
542 
543  while($row = $ilDB->fetchObject($r))
544  {
545  $mem_arr[] = array("id" => $row->usr_id,
546  "login" => $row->login,
547  "firstname" => $row->firstname,
548  "lastname" => $row->lastname,
549  "ilinc_id" => $row->ilinc_id
550  );
551  }
552 
553  return $mem_arr ? $mem_arr : array();
554  }
global $ilBench
Definition: ilias.php:18
$r

◆ getMemberIds()

ilObjiLincCourse::getMemberIds ( )

get all group Member ids regardless of role public

Returns
return array of users (obj_ids) that are assigned to the groupspecific roles (grp_member,grp_admin)

Definition at line 475 of file class.ilObjiLincCourse.php.

References getLocalRoles().

Referenced by isMember(), and removeMember().

476  {
477  global $rbacadmin, $rbacreview;
478 
479  $usr_arr= array();
480 
481  $rol = $this->getLocalRoles();
482 
483  foreach ($rol as $value)
484  {
485  foreach ($rbacreview->assignedUsers($value) as $member_id)
486  {
487  array_push($usr_arr,$member_id);
488  }
489  }
490 
491  $mem_arr = array_unique($usr_arr);
492 
493  return $mem_arr ? $mem_arr : array();
494  }
getLocalRoles($a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMemberRoles()

ilObjiLincCourse::getMemberRoles (   $a_user_id)

get group member status public

Parameters
integeruser_id
Returns
returns array of obj_ids of assigned local roles

Definition at line 458 of file class.ilObjiLincCourse.php.

References getLocalRoles().

Referenced by leave().

459  {
460  global $rbacadmin, $rbacreview;
461 
462  $arr_assignedRoles = array();
463 
464  $arr_assignedRoles = array_intersect($rbacreview->assignedRoles($a_user_id),$this->getLocalRoles());
465 
466  return $arr_assignedRoles;
467  }
getLocalRoles($a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMemberRolesTitle()

ilObjiLincCourse::getMemberRolesTitle (   $a_user_id)

get group member status public

Parameters
integeruser_id
Returns
returns string of role titles

Definition at line 601 of file class.ilObjiLincCourse.php.

References $ilBench, $in, $query, $r, $row, ilObjRole\_getTranslation(), DB_FETCHMODE_ASSOC, and getLocalRoles().

602  {
603  global $ilDB,$ilBench;
604 
605  include_once ('./Services/AccessControl/classes/class.ilObjRole.php');
606 
607  $str_member_roles ="";
608 
609  $data_types = array();
610  $data_values = array();
611 
612  $query = 'SELECT title FROM object_data
613  LEFT JOIN rbac_ua ON object_data.obj_id = rbac_ua.rol_id
614  WHERE object_data.type = %s
615  AND rbac_ua.usr_id = %s
616  AND rbac_ua.rol_id IN';
617 
618  array_push($data_types, 'text', 'integer');
619  array_push($data_values,'role', $a_user_id);
620 
621  $local_roles = $this->getLocalRoles();
622  $cnt_local_roles = count($local_roles);
623 
624  if (is_array($local_roles) &&
625  $cnt_local_roles > 0)
626  {
627  $in = '(';
628  $counter = 0;
629  foreach($local_roles as $local_role)
630  {
631  array_push($data_values, $local_role);
632  array_push($data_types, 'integer');
633 
634  if($counter > 0) $in .= ',';
635  $in .= '%s';
636  ++$counter;
637  }
638  $in .= ')';
639  $query .= $in;
640  }
641  $cnt_data_values = count($data_values);
642  $cnt_data_types = count($data_types);
643 
644  $r = $ilDB->queryf($query, $data_types, $data_values);
645 
646  while($row = $r->fetchRow(DB_FETCHMODE_ASSOC))
647  {
648  // display human readable role names for autogenerated roles
649  $str_member_roles .= ilObjRole::_getTranslation($row["title"]).", ";
650  }
651 
652  return substr($str_member_roles,0,-2);
653  }
_getTranslation($a_role_title)
getLocalRoles($a_translate=false)
get ALL local roles of group, also those created and defined afterwards only fetch data once from dat...
const DB_FETCHMODE_ASSOC
Definition: class.ilDB.php:10
global $ilBench
Definition: ilias.php:18
$r
+ Here is the call graph for this function:

◆ getSubItems()

ilObjiLincCourse::getSubItems ( )

get all subitems of the container overwrites method in ilContainerGUI

Definition at line 1267 of file class.ilObjiLincCourse.php.

References getClassrooms(), and ilUtil\sendInfo().

1268  {
1269  $objects = array();
1270 
1271  if(!($objects = $this->getClassrooms()))
1272  {
1273  ilUtil::sendInfo($this->lng->txt($this->getErrorMsg()));
1274  return array();
1275  }
1276 
1277  foreach((array)$objects as $key => $object)
1278  {
1279  $this->items['icla'][$key] = $object;
1280  }
1281 
1282  return is_array($this->items) ? $this->items : array();
1283  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ getViewMode()

ilObjiLincCourse::getViewMode ( )

Definition at line 56 of file class.ilObjiLincCourse.php.

References ilContainer\VIEW_ILINC.

57  {
59  }

◆ ilObjiLincCourse()

ilObjiLincCourse::ilObjiLincCourse (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Definition at line 45 of file class.ilObjiLincCourse.php.

References ilObject\ilObject(), and ilObject\setRegisterMode().

46  {
47  $this->type = 'icrs';
48  $this->ilObject($a_id,$a_call_by_reference);
49  $this->setRegisterMode(false);
50  $this->ilincAPI = new ilnetucateXMLAPI();
51 
52  $this->docent_ids = array();
53  $this->student_ids = array();
54  }
ilObject($a_id=0, $a_reference=true)
Constructor public.
API to communicate with a the CMSAPI of centra (c) Sascha Hofmann, 2004.
setRegisterMode($a_bool)
+ Here is the call graph for this function:

◆ initDefaultRoles()

ilObjiLincCourse::initDefaultRoles ( )

init default roles settings

public

Returns
array object IDs of created local roles.

Definition at line 279 of file class.ilObjiLincCourse.php.

References $r, $res, __setCourseStatus(), ilObject\createRoleFolder(), ilObject\getId(), and ilObject\getRefId().

280  {
281  global $rbacadmin, $rbacreview, $ilDB;
282 
283 
284  // create a local role folder
285  $rfoldObj =& $this->createRoleFolder();
286 
287  // ADMIN ROLE
288  // create role and assign role to rolefolder...
289  $roleObj = $rfoldObj->createRole("il_icrs_admin_".$this->getRefId(),"LearnLinc admin of seminar obj_no.".$this->getId());
290  $this->m_roleAdminId = $roleObj->getId();
291 
292  //set permission template of new local role
293  $res = $ilDB->queryf('
294  SELECT obj_id FROM object_data WHERE type= %s AND title= %s',
295  array('text', 'text'), array('rolt', 'il_icrs_admin'));
296 
297  $r = $ilDB->fetchObject($res);
298 
299  $rbacadmin->copyRoleTemplatePermissions($r->obj_id,ROLE_FOLDER_ID,$rfoldObj->getRefId(),$roleObj->getId());
300 
301  // set object permissions of icrs object
302  $ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"icrs",$rfoldObj->getRefId());
303  $rbacadmin->grantPermission($roleObj->getId(),$ops,$this->getRefId());
304 
305  // set object permissions of role folder object
306  //$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"rolf",$rfoldObj->getRefId());
307  //$rbacadmin->grantPermission($roleObj->getId(),$ops,$rfoldObj->getRefId());
308 
309  // MEMBER ROLE
310  // create role and assign role to rolefolder...
311  $roleObj = $rfoldObj->createRole("il_icrs_member_".$this->getRefId(),"LearnLinc admin of seminar obj_no.".$this->getId());
312  $this->m_roleMemberId = $roleObj->getId();
313 
314  //set permission template of new local role
315  $res = $ilDB->queryf('
316  SELECT obj_id FROM object_data WHERE type= %s AND title= %s',
317  array('text', 'text'), array('rolt', 'il_icrs_member'));
318 
319  $r = $ilDB->fetchObject($res);
320 
321  $rbacadmin->copyRoleTemplatePermissions($r->obj_id,ROLE_FOLDER_ID,$rfoldObj->getRefId(),$roleObj->getId());
322 
323  // set object permissions of icrs object
324  $ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"icrs",$rfoldObj->getRefId());
325  $rbacadmin->grantPermission($roleObj->getId(),$ops,$this->getRefId());
326 
327  // set object permissions of role folder object
328  //$ops = $rbacreview->getOperationsOfRole($roleObj->getId(),"rolf",$rfoldObj->getRefId());
329  //$rbacadmin->grantPermission($roleObj->getId(),$ops,$rfoldObj->getRefId());
330 
331  unset($rfoldObj);
332  unset($roleObj);
333 
334  $roles[] = $this->m_roleAdminId;
335  $roles[] = $this->m_roleMemberId;
336 
337  // Break inheritance and initialize permission settings using intersection method with a non_member_template
338  // not implemented for ilinc. maybe never will...
339  $this->__setCourseStatus();
340 
341  return $roles ? $roles : array();
342  }
getId()
get object id public
getRefId()
get reference id public
createRoleFolder()
creates a local role folder
$r
+ Here is the call graph for this function:

◆ isAdmin()

ilObjiLincCourse::isAdmin (   $a_user_id)

is Admin public

Parameters
integeruser_id
boolean,trueif user is group administrator

Definition at line 1091 of file class.ilObjiLincCourse.php.

References getDefaultRoles().

Referenced by removeMember().

1092  {
1093  global $rbacreview;
1094 
1095  $icrs_roles = $this->getDefaultRoles();
1096 
1097  if (in_array($a_user_id,$rbacreview->assignedUsers($icrs_roles["icrs_admin_role"])))
1098  {
1099  return true;
1100  }
1101  else
1102  {
1103  return false;
1104  }
1105  }
getDefaultRoles($a_grp_id="")
get default group roles, returns the defaultlike create roles il_grp_member, il_grp_admin public ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDocent()

ilObjiLincCourse::isDocent (   $a_user_obj = "")

Definition at line 824 of file class.ilObjiLincCourse.php.

References getiLincMemberIds().

825  {
826  if (!$a_user_obj)
827  {
828  $a_user_obj =& $this->ilias->account;
829  }
830 
831  $docents = $this->getiLincMemberIds(true);
832 
833  include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
834  $ilinc_user = new ilObjiLincUser($a_user_obj);
835 
836  if (in_array($ilinc_user->id,$docents))
837  {
838  return true;
839  }
840 
841  return false;
842  }
getiLincMemberIds($a_instructorflag=false)
redirection script todo: (a better solution should control the processing via a xml file) ...
Class ilObjiLincUser iLinc related user settings.
+ Here is the call graph for this function:

◆ isMember()

ilObjiLincCourse::isMember (   $a_user_id = "")

Definition at line 807 of file class.ilObjiLincCourse.php.

References getMemberIds().

Referenced by removeMember().

808  {
809  if (strlen($a_user_id) == 0)
810  {
811  $a_user_id = $this->ilias->account->getId();
812  }
813 
814  $arr_members = $this->getMemberIds();
815 
816  if (in_array($a_user_id, $arr_members))
817  {
818  return true;
819  }
820 
821  return false;
822  }
getMemberIds()
get all group Member ids regardless of role public
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ join()

ilObjiLincCourse::join (   $a_user_id,
  $a_mem_role = "" 
)

join icrs, assigns user to role private

Parameters
integermember status = obj_id of local_group_role

Definition at line 408 of file class.ilObjiLincCourse.php.

Referenced by addMember().

409  {
410  global $rbacadmin;
411 
412  if (is_array($a_mem_role))
413  {
414  foreach ($a_mem_role as $role)
415  {
416  $rbacadmin->assignUser($role,$a_user_id, false);
417  }
418  }
419  else
420  {
421  $rbacadmin->assignUser($a_mem_role,$a_user_id, false);
422  }
423 
424  return true;
425  }
+ Here is the caller graph for this function:

◆ leave()

ilObjiLincCourse::leave (   $a_user_id)

deassign member from group role private

Definition at line 431 of file class.ilObjiLincCourse.php.

References getMemberRoles().

Referenced by removeMember().

432  {
433  global $rbacadmin;
434 
435  $arr_groupRoles = $this->getMemberRoles($a_user_id);
436 
437  if (is_array($arr_groupRoles))
438  {
439  foreach ($arr_groupRoles as $groupRole)
440  {
441  $rbacadmin->deassignUser($groupRole, $a_user_id);
442  }
443  }
444  else
445  {
446  $rbacadmin->deassignUser($arr_groupRoles, $a_user_id);
447  }
448 
449  return true;
450  }
getMemberRoles($a_user_id)
get group member status public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ notify()

ilObjiLincCourse::notify (   $a_event,
  $a_ref_id,
  $a_parent_non_rbac_id,
  $a_node_id,
  $a_params = 0 
)

notifys an object about an event occured Based on the event happend, each object may decide how it reacts.

If you are not required to handle any events related to your module, just delete this method. (For an example how this method is used, look at ilObjGroup)

public

Parameters
stringevent
integerreference id of object where the event occured
arraypasses optional parameters if required
Returns
boolean

Definition at line 357 of file class.ilObjiLincCourse.php.

358  {
359  return true;
360  }

◆ read()

ilObjiLincCourse::read ( )

private

Definition at line 65 of file class.ilObjiLincCourse.php.

References $data, $ilErr, $r, ilDB\fetchObject(), PEAR\raiseError(), and ilUtil\yn2tf().

66  {
67  global $ilDB, $ilErr;
68 
69  parent::read();
70 
71  // TODO: fetching default role should be done in rbacadmin
72  $r = $ilDB->queryf('
73  SELECT * FROM ilinc_data
74  WHERE obj_id = %s',
75  array('integer'), array($this->id));
76 
77  if($ilDB->numRows($r) > 0)
78  {
79  $data = $ilDB->fetchObject($r);
80 
81  $this->ilinc_id = $data->course_id;
82  $this->activated = ilUtil::yn2tf($data->activation_offline);
83  $this->akclassvalue1 = $data->akclassvalue1;
84  $this->akclassvalue2 = $data->akclassvalue2;
85  }
86  else
87  {
88  $ilErr->raiseError("<b>Error: There is no dataset with id ".$this->id."!</b><br />class: ".get_class($this)."<br />Script: ".__FILE__."<br />Line: ".__LINE__, $ilErr->FATAL);
89  }
90  }
fetchObject($a_set)
Fetch row as object from result set.
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object&#39;s de...
Definition: PEAR.php:524
static yn2tf($a_yn)
convert "y"/"n" to true/false
$r
+ Here is the call graph for this function:

◆ registerUser()

ilObjiLincCourse::registerUser ( $a_user_obj,
  $a_instructor = false 
)

Definition at line 844 of file class.ilObjiLincCourse.php.

References getiLincId().

Referenced by addMember().

845  {
846  if ($a_instructor === true)
847  {
848  $a_instructor = "True";
849  }
850  else
851  {
852  $a_instructor = "False";
853  }
854 
855  include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
856  $ilinc_user = new ilObjiLincUser($a_user_obj);
857 
858  $user[] = array('id' => $ilinc_user->id, 'instructor' => $a_instructor);
859  $this->ilincAPI->registerUser($this->getiLincId(),$user);
860  $response = $this->ilincAPI->sendRequest("registerUser");
861 
862  if ($response->isError())
863  {
864  if (!$response->getErrorMsg())
865  {
866  $this->error_msg = "err_register_user";
867  }
868  else
869  {
870  $this->error_msg = $response->getErrorMsg();
871  }
872 
873  return false;
874  }
875 
876  return true;
877  }
Class ilObjiLincUser iLinc related user settings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerUsers()

ilObjiLincCourse::registerUsers (   $a_user_arr)

Definition at line 879 of file class.ilObjiLincCourse.php.

References getiLincId().

880  {
881  foreach ($a_user_arr as $user_id => $instructorflag)
882  {
883  $flag = "False";
884 
885  if ($instructorflag == ILINC_MEMBER_DOCENT)
886  {
887  $flag = "True";
888  }
889 
890  $ilinc_users[] = array('id' => $user_id,'instructor' => $flag);
891  }
892 
893  $this->ilincAPI->registerUser($this->getiLincId(),$ilinc_users);
894  $response = $this->ilincAPI->sendRequest("registerUser");
895 
896  if ($response->isError())
897  {
898  if (!$response->getErrorMsg())
899  {
900  $this->error_msg = "err_register_users";
901  }
902  else
903  {
904  $this->error_msg = $response->getErrorMsg();
905  }
906 
907  return false;
908  }
909 
910  return true;
911  }
+ Here is the call graph for this function:

◆ removeMember()

ilObjiLincCourse::removeMember ( $a_user_obj)

removes Member from group public

Definition at line 1051 of file class.ilObjiLincCourse.php.

References getAdminIds(), getMemberIds(), isAdmin(), isMember(), leave(), and unregisterUser().

1052  {
1053  if (!isset($a_user_obj))
1054  {
1055  $this->error_msg = get_class($this)."::removeMember(): Missing parameters !";
1056  return false;
1057  }
1058 
1059  if (!$this->isMember($a_user_obj->getId()))
1060  {
1061  return true;
1062  }
1063 
1064  if (count($this->getMemberIds()) > 1)
1065  {
1066  if ($this->isAdmin($a_user_obj->getId()) && count($this->getAdminIds()) < 2)
1067  {
1068  $this->error_msg = "ilinc_err_administrator_required";
1069  return false;
1070  }
1071  }
1072 
1073  // unregister from course on iLinc server
1074  if (!$this->unregisterUser($a_user_obj))
1075  {
1076  // error_msg already set
1077  return false;
1078  }
1079 
1080  $this->leave($a_user_obj->getId());
1081 
1082  return true;
1083  }
leave($a_user_id)
deassign member from group role private
isAdmin($a_user_id)
is Admin public
getMemberIds()
get all group Member ids regardless of role public
getAdminIds($a_grpId="")
get Group Admin Id public
+ Here is the call graph for this function:

◆ saveActivationStatus()

ilObjiLincCourse::saveActivationStatus (   $a_activated)

Definition at line 245 of file class.ilObjiLincCourse.php.

References ilObject\getId().

246  {
247  global $ilDB;
248 
249  $statement = $ilDB->manipulateF('
250  UPDATE ilinc_data
251  SET activation_offline = %s
252  WHERE obj_id = %s',
253  array('text', 'integer'),
254  array($a_activated, $this->getId()));
255 
256  }
getId()
get object id public
+ Here is the call graph for this function:

◆ saveAKClassValues()

ilObjiLincCourse::saveAKClassValues (   $a_akclassvalue1,
  $a_akclassvalue2 
)

Definition at line 259 of file class.ilObjiLincCourse.php.

References ilObject\getId().

260  {
261  global $ilDB;
262 
263  $statement = $ilDB->manipulateF('
264  UPDATE ilinc_data
265  SET akclassvalue1 = %s,
266  akclassvalue2 = %s
267  WHERE obj_id = %s',
268  array('text', 'text', 'integer'),
269  array($a_akclassvalue1, $a_akclassvalue2, $this->getId()));
270 
271  }
getId()
get object id public
+ Here is the call graph for this function:

◆ setAKClassValue1()

ilObjiLincCourse::setAKClassValue1 (   $a_str)

Definition at line 115 of file class.ilObjiLincCourse.php.

116  {
117  $this->akclassvalue1 = $a_str;
118  }

◆ setAKClassValue2()

ilObjiLincCourse::setAKClassValue2 (   $a_str)

Definition at line 120 of file class.ilObjiLincCourse.php.

121  {
122  $this->akclassvalue2 = $a_str;
123  }

◆ storeiLincId()

ilObjiLincCourse::storeiLincId (   $a_icrs_id)

Definition at line 230 of file class.ilObjiLincCourse.php.

231  {
232  global $ilDB;
233 
234  $statement = $ilDB->manipulateF('
235  INSERT INTO ilinc_data (
236  obj_id, i_type, course_id, activation_offline)
237  VALUES (%s, %s, %s, %s)',
238  array('integer', 'text', 'integer', 'text'),
239  array($this->id,'icrs',$a_icrs_id,$this->activated));
240 
241  $this->ilinc_id = $a_icrs_id;
242  }

◆ unregisterUser()

ilObjiLincCourse::unregisterUser (   $a_user_obj)

Definition at line 914 of file class.ilObjiLincCourse.php.

References getiLincId().

Referenced by removeMember().

915  {
916  include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
917  $ilinc_user = new ilObjiLincUser($a_user_obj);
918 
919  // do not send request if user is not registered at iLinc server at all
920  if ($ilinc_user->id == '0')
921  {
922  return true;
923  }
924 
925  $this->ilincAPI->unregisterUser($this->getiLincId(),array($ilinc_user->id));
926  $response = $this->ilincAPI->sendRequest();
927 
928  if ($response->isError())
929  {
930  if (!$response->getErrorMsg())
931  {
932  $this->error_msg = "err_unregister_user";
933  }
934  else
935  {
936  $this->error_msg = $response->getErrorMsg();
937  }
938 
939  return false;
940  }
941 
942  return true;
943  }
Class ilObjiLincUser iLinc related user settings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unregisterUsers()

ilObjiLincCourse::unregisterUsers (   $a_ilinc_user_ids)

Definition at line 945 of file class.ilObjiLincCourse.php.

References getiLincId().

946  {
947  $this->ilincAPI->unregisterUser($this->getiLincId(),$a_ilinc_user_ids);
948  $response = $this->ilincAPI->sendRequest();
949 
950  if ($response->isError())
951  {
952  if (!$response->getErrorMsg())
953  {
954  $this->error_msg = "err_unregister_users";
955  }
956  else
957  {
958  $this->error_msg = $response->getErrorMsg();
959  }
960 
961  return false;
962  }
963 
964  return true;
965  }
+ Here is the call graph for this function:

◆ update()

ilObjiLincCourse::update ( )

update object data

public

Returns
boolean

Definition at line 131 of file class.ilObjiLincCourse.php.

References $_POST, $r, getAKClassValue1(), getAKClassValue2(), ilObject\getId(), and getiLincId().

132  {
133  global $ilDB;
134 
135  $this->ilincAPI->editCourse($this->getiLincId(),$_POST["Fobject"]);
136  $response = $this->ilincAPI->sendRequest();
137 
138  if ($response->isError())
139  {
140  $this->error_msg = $response->getErrorMsg();
141  return false;
142  }
143 
144  // TODO: alter akclassvalues of classes here
145 
146  if (!parent::update())
147  {
148  $this->error_msg = "database_error";
149  return false;
150  }
151 
152  $db_activated_value = is_bool($this->activated) ? ($this->activated ? 'y' : 'n') : $this->activated;
153 
154  $r = $ilDB->manipulateF('
155  UPDATE ilinc_data
156  SET activation_offline = %s,
157  akclassvalue1 = %s,
158  akclassvalue2 = %s
159  WHERE obj_id = %s',
160  array('text', 'text', 'text', 'integer'),
161  array($db_activated_value, $this->getAKClassValue1(), $this->getAKClassValue2(), $this->getId()));
162 
163  return true;
164  }
$_POST['username']
Definition: cron.php:12
getId()
get object id public
$r
+ Here is the call graph for this function:

◆ updateClassrooms()

ilObjiLincCourse::updateClassrooms ( )

Definition at line 725 of file class.ilObjiLincCourse.php.

References $_POST, $data, $ilErr, and getiLincId().

726  {
727  global $ilErr;
728 
729  $this->ilincAPI->findCourseClasses($this->getiLincId());
730  $response = $this->ilincAPI->sendRequest();
731 
732  if ($response->isError())
733  {
734  if (!$response->getErrorMsg())
735  {
736  $this->error_msg = "err_get_classrooms";
737  }
738  else
739  {
740  $this->error_msg = $response->getErrorMsg();
741  }
742 
743  return false;
744  }
745 
746  if (!$response->data['classes'])
747  {
748 
749  $this->error_msg = $response->data['result']['cdata'];
750  return false;
751  }
752 
753  if (array_key_exists('akclassvalue1',$_POST["Fobject"]))
754  {
755  $data["akclassvalue1"] = $_POST["Fobject"]["akclassvalue1"];
756  }
757 
758  if (array_key_exists('akclassvalue2',$_POST["Fobject"]))
759  {
760  $data["akclassvalue2"] = $_POST["Fobject"]["akclassvalue2"];
761  }
762 
763  foreach ($response->data['classes'] as $class_id => $data2)
764  {
765  include_once("./Modules/ILinc/classes/class.ilObjiLincClassroom.php");
766  $icla_obj = new ilObjiLincClassroom($class_id,$this->ref_id);
767 
768  if (!$icla_obj->update($data))
769  {
770  $this->error_msg = $icla_obj->getErrorMsg();
771 
772  return false;
773  }
774 
775  unset($icla_obj);
776  }
777 
778  return true;
779  }
$_POST['username']
Definition: cron.php:12
Class ilObjiLincClassroom.
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
+ Here is the call graph for this function:

◆ uploadPicture()

ilObjiLincCourse::uploadPicture ( $a_user_obj,
  $a_lang 
)

Definition at line 994 of file class.ilObjiLincCourse.php.

995  {
996  $this->ilincAPI->uploadPicture($a_user_obj,$a_lang);
997  $response = $this->ilincAPI->sendRequest("uploadPicture");
998 
999  if ($response->isError())
1000  {
1001  if (!$response->getErrorMsg())
1002  {
1003  $this->error_msg = "err_upload_picture";
1004  }
1005  else
1006  {
1007  $this->error_msg = $response->getErrorMsg();
1008  }
1009 
1010  return false;
1011  }
1012 
1013  // return URL to user's personal page
1014  return $response->data['url']['cdata'];
1015  }

◆ userExists()

ilObjiLincCourse::userExists ( $a_user_obj)

Definition at line 783 of file class.ilObjiLincCourse.php.

Referenced by addMember().

784  {
785  //$data = $a_user_obj->getiLincData();
786 
787  include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
788  $ilinc_user = new ilObjiLincUser($a_user_obj);
789 
790  if (!$ilinc_user->id and !$ilinc_user->login)
791  {
792  return false;
793  }
794 
795  return true;
796  }
Class ilObjiLincUser iLinc related user settings.
+ Here is the caller graph for this function:

◆ userLogin()

ilObjiLincCourse::userLogin ( $a_user_obj)

Definition at line 967 of file class.ilObjiLincCourse.php.

968  {
969  include_once ('./Modules/ILinc/classes/class.ilObjiLincUser.php');
970  $ilinc_user = new ilObjiLincUser($a_user_obj);
971 
972  $this->ilincAPI->userLogin($ilinc_user);
973  $response = $this->ilincAPI->sendRequest("userLogin");
974 
975  if ($response->isError())
976  {
977  if (!$response->getErrorMsg())
978  {
979  $this->error_msg = "err_user_login";
980  }
981  else
982  {
983  $this->error_msg = $response->getErrorMsg();
984  }
985 
986  return false;
987  }
988 
989  // return URL to join class room
990  return $response->data['url']['cdata'];
991  }
Class ilObjiLincUser iLinc related user settings.

The documentation for this class was generated from the following file: