public function __construct(CourseSessionRegistrationQueue $queue)
 {
     $session = $queue->getSession();
     $course = $session->getCourse();
     $user = $queue->getUser();
     $organizationAdmin = $queue->getOrganizationAdmin();
     $details = [];
     $details['userId'] = $user->getId();
     $details['username'] = $user->getUsername();
     $details['firsName'] = $user->getFirstName();
     $details['lastName'] = $user->getLastName();
     $details['courseId'] = $course->getId();
     $details['courseTitle'] = $course->getTitle();
     $details['courseCode'] = $course->getCode();
     $details['sessionId'] = $session->getId();
     $details['sessionName'] = $session->getName();
     $details['sessionStatus'] = $session->getSessionStatus();
     $details['sessionType'] = $session->getType();
     $details['organizationAdminId'] = $organizationAdmin->getId();
     $details['organizationAdminUsername'] = $organizationAdmin->getUsername();
     $details['organizationAdminFirsName'] = $organizationAdmin->getFirstName();
     $details['organizationAdminLastName'] = $organizationAdmin->getLastName();
     $details['organizationValidationDate'] = $queue->getOrganizationValidationDate();
     parent::__construct(self::ACTION, $details, $user);
 }
 /**
  * Constructor.
  * ChangeSet expected variable is array which contain all modified properties, in the following form:
  * (
  *      'propertyName1' => ['property old value 1', 'property new value 1'],
  *      'propertyName2' => ['property old value 2', 'property new value 2'],
  *      etc.
  * )
  *
  * Please respect lower caml case naming convention for property names
  */
 public function __construct($role, $resource, $changeSet)
 {
     $this->role = $role;
     $this->changeSet = $changeSet;
     $this->details = array('role' => array('name' => $role->getTranslationKey(), 'changeSet' => $changeSet), 'workspace' => array('name' => $resource->getWorkspace() ? $resource->getWorkspace()->getName() : ' - '), 'resource' => array('name' => $resource->getName(), 'path' => $resource->getPathForDisplay(), 'id' => $resource->getId(), 'resourceType' => $resource->getResourceType()->getName()));
     parent::__construct(self::ACTION, $this->details, null, null, $resource, $role, $resource->getWorkspace());
 }
 public function __construct(Course $course)
 {
     $details = [];
     $details['id'] = $course->getId();
     $details['title'] = $course->getTitle();
     $details['code'] = $course->getCode();
     $details['publicRegistration'] = $course->getPublicRegistration();
     $details['publicUnregistration'] = $course->getPublicUnregistration();
     $details['registrationValidation'] = $course->getRegistrationValidation();
     $details['icon'] = $course->getIcon();
     $details['tutorRoleName'] = $course->getTutorRoleName();
     $details['learnerRoleName'] = $course->getLearnerRoleName();
     $details['userValidation'] = $course->getUserValidation();
     $details['organizationValidation'] = $course->getOrganizationValidation();
     $details['maxUsers'] = $course->getMaxUsers();
     $details['defaultSessionDuration'] = $course->getDefaultSessionDuration();
     $details['withSessionEvent'] = $course->getWithSessionEvent();
     $workspace = $course->getWorkspace();
     $workspaceModel = $course->getWorkspaceModel();
     if (!is_null($workspace)) {
         $details['workspaceId'] = $workspace->getId();
         $details['workspaceName'] = $workspace->getName();
         $details['workspaceCode'] = $workspace->getCode();
         $details['workspaceGuid'] = $workspace->getGuid();
     }
     if (!is_null($workspaceModel)) {
         $details['workspaceModelId'] = $workspaceModel->getId();
         $details['workspaceModelName'] = $workspaceModel->getName();
     }
     parent::__construct(self::ACTION, $details);
 }
 /**
  * Constructor.
  */
 public function __construct(HomeTab $homeTab, WidgetHomeTabConfig $whtc, WidgetDisplayConfig $wdc = null)
 {
     $widgetInstance = $whtc->getWidgetInstance();
     $widget = $widgetInstance->getWidget();
     $details = [];
     $details['tabId'] = $homeTab->getId();
     $details['tabName'] = $homeTab->getName();
     $details['tabType'] = $homeTab->getType();
     $details['tabIcon'] = $homeTab->getIcon();
     $details['widgetId'] = $widget->getId();
     $details['widgetName'] = $widget->getName();
     $details['widgetIsConfigurable'] = $widget->isConfigurable();
     $details['widgetIsExportable'] = $widget->isExportable();
     $details['widgetIsDisplayableInWorkspace'] = $widget->isDisplayableInWorkspace();
     $details['widgetIsDisplayableInDesktop'] = $widget->isDisplayableInDesktop();
     $details['id'] = $widgetInstance->getId();
     $details['name'] = $widgetInstance->getName();
     $details['icon'] = $widgetInstance->getIcon();
     $details['isAdmin'] = $widgetInstance->isAdmin();
     $details['isDesktop'] = $widgetInstance->isDesktop();
     $details['widgetHomeTabConfigId'] = $whtc->getId();
     $details['order'] = $whtc->getWidgetOrder();
     $details['type'] = $whtc->getType();
     $details['visible'] = $whtc->isVisible();
     $details['locked'] = $whtc->isLocked();
     if (!is_null($wdc)) {
         $details['widgetDisplayConfigId'] = $wdc->getId();
         $details['row'] = $wdc->getRow();
         $details['column'] = $wdc->getColumn();
         $details['width'] = $wdc->getWidth();
         $details['height'] = $wdc->getHeight();
         $details['color'] = $wdc->getColor();
     }
     parent::__construct(self::ACTION, $details);
 }
Пример #5
0
 public function __construct(Cursus $cursus)
 {
     $details = [];
     $details['id'] = $cursus->getId();
     $details['title'] = $cursus->getTitle();
     $details['code'] = $cursus->getCode();
     $details['blocking'] = $cursus->isBlocking();
     $details['details'] = $cursus->getDetails();
     $details['root'] = $cursus->getRoot();
     $details['lvl'] = $cursus->getLvl();
     $details['lft'] = $cursus->getLft();
     $details['rgt'] = $cursus->getRgt();
     $parent = $cursus->getParent();
     $course = $cursus->getCourse();
     $workspace = $cursus->getWorkspace();
     if (!is_null($parent)) {
         $details['parentId'] = $parent->getId();
         $details['parentTitle'] = $parent->getTitle();
         $details['parentCode'] = $parent->getCode();
     }
     if (!is_null($course)) {
         $details['courseId'] = $course->getId();
         $details['courseTitle'] = $course->getTitle();
         $details['courseCode'] = $course->getCode();
     }
     if (!is_null($workspace)) {
         $details['workspaceId'] = $workspace->getId();
         $details['workspaceName'] = $workspace->getName();
         $details['workspaceCode'] = $workspace->getCode();
         $details['workspaceGuid'] = $workspace->getGuid();
     }
     parent::__construct(self::ACTION, $details);
 }
Пример #6
0
 /**
  * Constructor.
  * ChangeSet expected variable is array which contain all modified properties, in the following form:
  * (
  *      'propertyName1' => ['property old value 1', 'property new value 1'],
  *      'propertyName2' => ['property old value 2', 'property new value 2'],
  *      etc.
  * )
  *
  * Please respect lower caml case naming convention for property names
  */
 public function __construct(ResourceNode $node, $changeSet)
 {
     $action = self::ACTION;
     if ($changeSet != null and count($changeSet) == 1 and array_key_exists('name', $changeSet)) {
         $action = self::ACTION_RENAME;
     }
     parent::__construct($action, array('resource' => array('name' => $node->getName(), 'path' => $node->getPathForDisplay(), 'changeSet' => $changeSet), 'workspace' => array('name' => $node->getWorkspace()->getName()), 'owner' => array('lastName' => $node->getCreator()->getLastName(), 'firstName' => $node->getCreator()->getFirstName())), null, null, $node, null, $node->getWorkspace(), $node->getCreator());
 }
 public function __construct(SurveyAnswer $surveyAnswer)
 {
     $survey = $surveyAnswer->getSurvey();
     $resourceNode = $survey->getResourceNode();
     $user = $surveyAnswer->getUser();
     $details = ['answer_date' => $surveyAnswer->getAnswerDate(), 'nb_answers' => $surveyAnswer->getNbAnswers()];
     parent::__construct(self::ACTION, $details, $user, null, $resourceNode, null, $resourceNode->getWorkspace());
 }
Пример #8
0
 /**
  * @param Badge $badge
  * @param User  $receiver
  */
 public function __construct(Badge $badge, User $receiver, $doer)
 {
     if (null === $doer) {
         $this->doer = LogGenericEvent::PLATFORM_EVENT_TYPE;
     }
     $this->badge = $badge;
     parent::__construct(self::ACTION, array('badge' => array('id' => $badge->getId()), 'receiverUser' => array('lastName' => $receiver->getLastName(), 'firstName' => $receiver->getFirstName())), $receiver, null, null, null, $badge->getWorkspace());
 }
 public function __construct(Cursus $cursus, User $user)
 {
     $details = [];
     $details['username'] = $user->getUsername();
     $details['firsName'] = $user->getFirstName();
     $details['lastName'] = $user->getLastName();
     $details['cursusId'] = $cursus->getId();
     $details['cursusTitle'] = $cursus->getTitle();
     $details['cursusCode'] = $cursus->getCode();
     parent::__construct(self::ACTION, $details, $user);
 }
 /**
  * Constructor.
  */
 public function __construct(WorkspaceRegistrationQueue $queue)
 {
     $this->user = $queue->getUser();
     $this->workspace = $queue->getWorkspace();
     $this->role = $queue->getRole();
     $details = array('role' => array('name' => $this->role->getTranslationKey()));
     $details['workspace'] = array('name' => $this->workspace->getName(), 'id' => $this->workspace->getId());
     $details['receiverUser'] = array('firstName' => $this->user->getFirstName(), 'lastName' => $this->user->getLastName());
     $this->details = $details;
     parent::__construct(self::ACTION, $this->details, $this->user, null, null, $this->role, $this->workspace);
 }
 public function __construct(CursusUser $cursusUser)
 {
     $cursus = $cursusUser->getCursus();
     $user = $cursusUser->getUser();
     $details = [];
     $details['username'] = $user->getUsername();
     $details['firsName'] = $user->getFirstName();
     $details['lastName'] = $user->getLastName();
     $details['cursusId'] = $cursus->getId();
     $details['cursusTitle'] = $cursus->getTitle();
     $details['cursusCode'] = $cursus->getCode();
     $details['registrationDate'] = $cursusUser->getRegistrationDate()->format('d/m/Y H:i:s');
     parent::__construct(self::ACTION, $details, $user);
 }
 public function __construct(CourseRegistrationQueue $queue)
 {
     $course = $queue->getCourse();
     $user = $queue->getUser();
     $details = [];
     $details['userId'] = $user->getId();
     $details['username'] = $user->getUsername();
     $details['firsName'] = $user->getFirstName();
     $details['lastName'] = $user->getLastName();
     $details['courseId'] = $course->getId();
     $details['courseTitle'] = $course->getTitle();
     $details['courseCode'] = $course->getCode();
     parent::__construct(self::ACTION, $details, $user);
 }
 public function __construct(CourseSession $session, User $user)
 {
     $course = $session->getCourse();
     $details = array();
     $details['username'] = $user->getUsername();
     $details['firsName'] = $user->getFirstName();
     $details['lastName'] = $user->getLastName();
     $details['sessionId'] = $session->getId();
     $details['sessionName'] = $session->getName();
     $details['sessionCreationDate'] = $session->getCreationDate()->format('d/m/Y H:i:s');
     $details['courseId'] = $course->getId();
     $details['courseTitle'] = $course->getTitle();
     $details['courseCode'] = $course->getCode();
     parent::__construct(self::ACTION, $details, $user);
 }
 /**
  * Constructor.
  */
 public function __construct(HomeTabConfig $htc)
 {
     $homeTab = $htc->getHomeTab();
     $details = [];
     $details['tabId'] = $homeTab->getId();
     $details['tabName'] = $homeTab->getName();
     $details['tabType'] = $homeTab->getType();
     $details['tabIcon'] = $homeTab->getIcon();
     $details['configId'] = $htc->getId();
     $details['type'] = $htc->getType();
     $details['locked'] = $htc->isLocked();
     $details['visible'] = $htc->isVisible();
     $details['tabOrder'] = $htc->getTabOrder();
     $details['details'] = $htc->getDetails();
     parent::__construct(self::ACTION, $details);
 }
 public function __construct(SessionEvent $sessionEvent, User $user)
 {
     $session = $sessionEvent->getSession();
     $course = $session->getCourse();
     $details = [];
     $details['username'] = $user->getUsername();
     $details['firsName'] = $user->getFirstName();
     $details['lastName'] = $user->getLastName();
     $details['sessionEventId'] = $sessionEvent->getId();
     $details['sessionEventName'] = $sessionEvent->getName();
     $details['sessionId'] = $session->getId();
     $details['sessionName'] = $session->getName();
     $details['courseId'] = $course->getId();
     $details['courseTitle'] = $course->getTitle();
     $details['courseCode'] = $course->getCode();
     parent::__construct(self::ACTION, $details, $user);
 }
Пример #16
0
 /**
  * Constructor.
  */
 public function __construct(Role $role, AbstractRoleSubject $subject)
 {
     $this->role = $role;
     $details = array('role' => array('name' => $role->getTranslationKey()));
     if ($role->getWorkspace()) {
         $details['workspace'] = array('name' => $role->getWorkspace()->getName(), 'id' => $role->getWorkspace()->getId());
     }
     if ($subject instanceof User) {
         $details['receiverUser'] = array('firstName' => $subject->getFirstName(), 'lastName' => $subject->getLastName());
         $this->receiver = $subject;
     } else {
         $details['receiverGroup'] = array('name' => $subject->getName());
         $this->receiverGroup = $subject;
     }
     $this->details = $details;
     parent::__construct($this->getActionKey(), $details, $this->receiver, $this->receiverGroup, null, $role, $role->getWorkspace());
 }
 public function __construct(SessionEvent $sessionEvent)
 {
     $session = $sessionEvent->getSession();
     $course = $session->getCourse();
     $details = [];
     $details['id'] = $sessionEvent->getId();
     $details['name'] = $sessionEvent->getName();
     $details['startDate'] = $sessionEvent->getStartDate();
     $details['endDate'] = $sessionEvent->getEndDate();
     $details['sessionId'] = $session->getId();
     $details['sessionName'] = $session->getName();
     $details['courseId'] = $course->getId();
     $details['courseTitle'] = $course->getTitle();
     $details['courseCode'] = $course->getCode();
     foreach ($sessionEvent->getTutors() as $tutor) {
         $details['tutors'][] = ['id' => $tutor->getId(), 'username' => $tutor->getUsername(), 'firstName' => $tutor->getFirstName(), 'lastName' => $tutor->getLastName(), 'guid' => $tutor->getGuid()];
     }
     parent::__construct(self::ACTION, $details);
 }
Пример #18
0
 /**
  * Constructor.
  */
 public function __construct(Role $role, AbstractRoleSubject $subject)
 {
     $receiver = null;
     $receiverGroup = null;
     $details = array('role' => array('name' => $role->getTranslationKey()));
     if ($role->getWorkspace()) {
         $details['workspace'] = array('name' => $role->getWorkspace()->getName());
     }
     if ($subject instanceof User) {
         $details['receiverUser'] = array('firstName' => $subject->getFirstName(), 'lastName' => $subject->getLastName());
         $action = self::ACTION_USER;
         $receiver = $subject;
     } else {
         $details['receiverGroup'] = array('name' => $subject->getName());
         $action = self::ACTION_GROUP;
         $receiverGroup = $subject;
     }
     parent::__construct($action, $details, $receiver, $receiverGroup, null, $role, $role->getWorkspace());
 }
 public function __construct(CourseSession $session)
 {
     $course = $session->getCourse();
     $workspace = $session->getWorkspace();
     $learnerRole = $session->getLearnerRole();
     $tutorRole = $session->getTutorRole();
     $details = [];
     $details['id'] = $session->getId();
     $details['name'] = $session->getName();
     $details['defaultSession'] = $session->isDefaultSession();
     $details['creationDate'] = $session->getCreationDate();
     $details['publicRegistration'] = $session->getPublicRegistration();
     $details['publicUnregistration'] = $session->getPublicUnregistration();
     $details['registrationValidation'] = $session->getRegistrationValidation();
     $details['startDate'] = $session->getStartDate();
     $details['endDate'] = $session->getEndDate();
     $details['extra'] = $session->getExtra();
     $details['userValidation'] = $session->getUserValidation();
     $details['organizationValidation'] = $session->getOrganizationValidation();
     $details['maxUsers'] = $session->getMaxUsers();
     $details['type'] = $session->getType();
     $details['courseId'] = $course->getId();
     $details['courseTitle'] = $course->getTitle();
     $details['courseCode'] = $course->getCode();
     if (!is_null($workspace)) {
         $details['workspaceId'] = $workspace->getId();
         $details['workspaceName'] = $workspace->getName();
         $details['workspaceCode'] = $workspace->getCode();
         $details['workspaceGuid'] = $workspace->getGuid();
     }
     if (!is_null($learnerRole)) {
         $details['learnerRoleId'] = $learnerRole->getId();
         $details['learnerRoleName'] = $learnerRole->getName();
         $details['learnerRoleKey'] = $learnerRole->getTranslationKey();
     }
     if (!is_null($tutorRole)) {
         $details['tutorRoleId'] = $tutorRole->getId();
         $details['tutorRoleName'] = $tutorRole->getName();
         $details['tutorRoleKey'] = $tutorRole->getTranslationKey();
     }
     parent::__construct(self::ACTION, $details);
 }
 /**
  * Constructor.
  */
 public function __construct(HomeTabConfig $htc)
 {
     $workspace = $htc->getWorkspace();
     $homeTab = $htc->getHomeTab();
     $details = [];
     $details['tabId'] = $homeTab->getId();
     $details['tabName'] = $homeTab->getName();
     $details['tabType'] = $homeTab->getType();
     $details['tabIcon'] = $homeTab->getIcon();
     $details['configId'] = $htc->getId();
     $details['type'] = $htc->getType();
     $details['locked'] = $htc->isLocked();
     $details['visible'] = $htc->isVisible();
     $details['tabOrder'] = $htc->getTabOrder();
     $details['details'] = $htc->getDetails();
     $details['workspaceId'] = $workspace->getId();
     $details['workspaceCode'] = $workspace->getCode();
     $details['workspaceName'] = $workspace->getName();
     $details['workspaceGuid'] = $workspace->getGuid();
     parent::__construct(self::ACTION, $details, null, null, null, null, $workspace);
 }
 public function __construct(SessionEventUser $sessionEventUser)
 {
     $sessionEvent = $sessionEventUser->getSessionEvent();
     $session = $sessionEvent->getSession();
     $course = $session->getCourse();
     $user = $sessionEventUser->getUser();
     $details = [];
     $details['username'] = $user->getUsername();
     $details['firsName'] = $user->getFirstName();
     $details['lastName'] = $user->getLastName();
     $details['sessionEventId'] = $sessionEvent->getId();
     $details['sessionEventName'] = $sessionEvent->getName();
     $details['sessionId'] = $session->getId();
     $details['sessionName'] = $session->getName();
     $details['sessionCreationDate'] = $session->getCreationDate()->format('d/m/Y H:i:s');
     $details['courseId'] = $course->getId();
     $details['courseTitle'] = $course->getTitle();
     $details['courseCode'] = $course->getCode();
     $registrationDate = $sessionEventUser->getRegistrationDate();
     if (!is_null($registrationDate)) {
         $details['registrationDate'] = $registrationDate->format('d/m/Y H:i:s');
     }
     parent::__construct(self::ACTION, $details, $user);
 }
 /**
  * Constructor.
  *
  * LogResourceEvent is used by plugins for creating custom events when
  * action occured on a resource, or child resource (e.g. post in forum,
  * comment in blog, event in calendar etc.)
  *
  * Possible changes over a resource's child are: creation, delete, update, published, unpublished, etc.
  *
  * "$details" is an array that contains all necessary info to describe indirect resource modification.
  *
  * For example when a comment is published to a blog resource the details could be:
  *
  * array(
  *      'comment' => array(
  *          'text' => 'Very useful post thx',
  *          'owner' => array(
  *              'username' => 'JohnDoe',
  *              'email' => '*****@*****.**'
  *          )
  *      )
  * )
  *
  * Please respect lowerCamelCase naming convention for property names in details
  */
 public function __construct(ResourceNode $node, $details)
 {
     $commonDetails = array('resource' => array('name' => $node->getName(), 'path' => $node->getPathForDisplay()), 'workspace' => array('name' => $node->getWorkspace()->getName()), 'owner' => array('lastName' => $node->getCreator()->getLastName(), 'firstName' => $node->getCreator()->getFirstName()));
     $detailsData = array_merge($commonDetails, $details);
     parent::__construct(static::ACTION, $detailsData, null, null, $node, null, $node->getWorkspace(), $node->getCreator(), null);
 }
 /**
  * Constructor.
  * ChangeSet expected variable is array which contain all modified properties, in the following form:
  * (
  *      'propertyName1' => ['property old value 1', 'property new value 1'],
  *      'propertyName2' => ['property old value 2', 'property new value 2'],
  *      etc.
  * ).
  *
  * Please respect lower caml case naming convention for property names
  */
 public function __construct(ResourceNode $node, array $usersToNotify = array())
 {
     $action = self::ACTION;
     $this->usersToNotify = $usersToNotify;
     parent::__construct($action, array('resource' => array('name' => $node->getName(), 'path' => $node->getPathForDisplay()), 'workspace' => array('name' => $node->getWorkspace()->getName(), 'id' => $node->getWorkspace()->getId(), 'guid' => $node->getWorkspace()->getGuid()), 'owner' => array('lastName' => $node->getCreator()->getLastName(), 'firstName' => $node->getCreator()->getFirstName())), null, null, $node, null, $node->getWorkspace(), $node->getCreator());
 }
 /**
  * Constructor.
  */
 public function __construct(User $user, Workspace $workspace, $details = [])
 {
     parent::__construct(self::ACTION, $details, $user, null, null, null, $workspace);
 }
Пример #25
0
 /**
  * Constructor.
  */
 public function __construct(ResourceNode $node, array $usersToNotify = array())
 {
     $this->usersToNotify = $usersToNotify;
     $this->node = $node;
     parent::__construct(self::ACTION, array('resource' => array('name' => $node->getName(), 'path' => $node->getPathForCreationLog(), 'guid' => $node->getGuid(), 'resourceType' => $node->getResourceType()->getName()), 'workspace' => array('name' => $node->getWorkspace() ? $node->getWorkspace()->getName() : ' - '), 'owner' => array('lastName' => $node->getCreator()->getLastName(), 'firstName' => $node->getCreator()->getFirstName())), null, null, $node, null, $node->getWorkspace(), $node->getCreator());
 }
 /**
  * @param Portfolio      $portfolio
  * @param PortfolioGuide $portfolioGuide
  */
 public function __construct(Portfolio $portfolio, PortfolioGuide $portfolioGuide)
 {
     $this->portfolio = $portfolio;
     $user = $portfolio->getUser();
     parent::__construct(self::ACTION, array('owner' => array('lastName' => $user->getLastName(), 'firstName' => $user->getFirstName()), 'portfolio' => array('id' => $this->portfolio->getId(), 'title' => $this->portfolio->getTitle(), 'slug' => $this->portfolio->getSlug())), $portfolioGuide->getUser(), null, null, null, null, $user);
 }
Пример #27
0
 public function __construct(Survey $survey, User $user)
 {
     parent::__construct(self::ACTION, array(), $user, null, $survey->getResourceNode(), null, $survey->getResourceNode()->getWorkspace());
 }
 /**
  * Constructor.
  */
 public function __construct(ResourceNode $node)
 {
     parent::__construct(self::ACTION, array('resource' => array('name' => $node->getName(), 'path' => $node->getPathForDisplay()), 'workspace' => array('name' => $node->getWorkspace()->getName()), 'owner' => array('lastName' => $node->getCreator()->getLastName(), 'firstName' => $node->getCreator()->getFirstName())), null, null, $node, null, $node->getWorkspace(), $node->getCreator());
 }
 public function __construct(array $details)
 {
     parent::__construct(self::ACTION, $details);
 }
 public function __construct(Scorm12Resource $scormResource, User $user, array $details)
 {
     parent::__construct(self::ACTION, $details, $user, null, $scormResource->getResourceNode(), null, $scormResource->getResourceNode()->getWorkspace());
 }