Beispiel #1
1
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if (($event->getEventData() === null || !is_string($event->getEventData())) && ($event->getReceiver() === null || !is_string($event->getReceiver()))) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     if ($event->getEventData() === null) {
         $event->setEventData($event->getSender());
     }
     $event->setMessageInformation(array('User %s shared a file with you.', array(PeopleEventHandler::retrieveContactName($event->getSender()))));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null) {
         throw new EyeInvalidArgumentException('You must specify the eventData property');
     }
     $eventData = $event->getEventData();
     if (!isset($eventData['usersId']) || !is_string($eventData['usersId'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'usersId\']');
     }
     if (!isset($eventData['listId']) || !is_int($eventData['listId'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'listId\']');
     }
     $userIds = $eventData['usersId'];
     $listName = PeopleEventHandler::getListName($eventData['listId']);
     if (!is_array($userIds)) {
         $username = PeopleEventHandler::retrieveContactName($userIds);
         $event->setMessageInformation(array('User %s was added in %s list.', array($username, $listName)));
     } else {
         $usernames = array();
         foreach ($userIds as $userId) {
             $usernames[] = PeopleEventHandler::retrieveContactName($userId);
         }
         $usernamesString = implode(', ', $usernames);
         $event->setMessageInformation(array('Users %s were added in %s list.', array($usernamesString, $listName)));
     }
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null) {
         throw new EyeInvalidArgumentException('You must specify the eventData property');
     }
     $eventData = $event->getEventData();
     if (!isset($eventData['userId']) || !is_string($eventData['userId'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'userId\']');
     }
     if (!isset($eventData['groupId']) || !is_string($eventData['groupId'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'groupId\']');
     }
     $userId = $eventData['userId'];
     $username = GroupsEventHandler::retrieveContactName($userId);
     $wGroupId = $eventData['groupId'];
     $wGroupName = GroupsEventHandler::retrieveWorkgroupName($wGroupId);
     //Event sent to the owner of the group
     if ($event->getReceiver() !== $userId) {
         $event->setMessageInformation(array('User %s was banned from %s group.', array($username, $wGroupName)));
     } else {
         //Event sent to the banned user
         $event->setMessageInformation(array('You were banned from %s group.', array($wGroupName)));
     }
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null || !is_string($event->getEventData())) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     $username = PeopleEventHandler::retrieveContactName($event->getEventData());
     $event->setMessageInformation(array('User %s was deleted from your People', array($username)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  * 
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null || !is_string($event->getEventData())) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     $username = PeopleEventHandler::retrieveContactName($event->getEventData());
     $event->setMessageInformation(array('%s has been added to your eyeOS Network. He/she must confirm you', array($username)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null || !is_string($event->getEventData())) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     $wGroupName = $event->getEventData();
     $event->setMessageInformation(array('The Group %s was created.', array($wGroupName)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null || !is_string($event->getEventData())) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData');
     }
     $username = PeopleEventHandler::retrieveContactName($event->getEventData());
     $event->setMessageInformation(array('The request for friendship for user %s was canceled by you.', array($username)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null || !is_int($event->getEventData())) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     $listId = $event->getEventData();
     $listName = PeopleEventHandler::getListName($listId);
     $event->setMessageInformation(array('The list %s was created in People', array($listName)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     $eventData = $event->getEventData();
     if (!isset($eventData) || !is_string($eventData)) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'listId\']');
     }
     $wGroupName = $eventData;
     $event->setMessageInformation(array('The Group %s was deleted.', array($wGroupName)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null || !is_string($event->getEventData())) {
         // If the event was fired by the user itself, set the eventData field
         if ($event->getReceiver() == ProcManager::getInstance()->getCurrentProcess()->getLoginContext()->getEyeosUser()->getId()) {
             $event->setEventData($event->getReceiver());
         } else {
             throw new EyeInvalidArgumentException('Missing or invalid $eventData');
         }
     }
     $userId = $event->getEventData();
     if ($userId == ProcManager::getInstance()->getCurrentProcess()->getLoginContext()->getEyeosUser()->getId()) {
         $event->setMessageInformation('Your profile was updated');
     } else {
         $username = PeopleEventHandler::retrieveContactName($userId);
         $event->setMessageInformation(array('User %s update his/her profile', array($username)));
     }
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null || !is_string($event->getEventData())) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     $wGroupId = $event->getEventData();
     $wGroupName = GroupsEventHandler::retrieveWorkgroupName($wGroupId);
     $username = GroupsEventHandler::retrieveContactName($event->getReceiver());
     $event->setMessageInformation(array('You request the membership for the group %s.', array($wGroupName)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getSender() === null || !is_string($event->getSender())) {
         throw new EyeInvalidArgumentException('Missing or invalid sender property');
     }
     $username = PeopleEventHandler::retrieveContactName($event->getSender());
     $event->setMessageInformation(array('User %s would like to add you to his/her eyeOS Network.', array($username)));
     $event->setIsQuestion(true);
     $event->setQuestion('Do you want to confirm?');
     $event->setAvailableAnswers('Confirm#Cancel');
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null || !is_string($event->getEventData())) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData');
     }
     $wGroupId = $event->getEventData();
     $wGroupName = GroupsEventHandler::retrieveWorkgroupName($wGroupId);
     //Event sent to the owner of the group
     $event->setMessageInformation(array('You were accepted in the group %s.', array($wGroupName)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if (($event->getEventData() === null || !is_string($event->getEventData())) && ($event->getReceiver() === null || !is_string($event->getReceiver()))) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     if ($event->getEventData() === null) {
         $event->setEventData($event->getSender());
     }
     $username = PeopleEventHandler::retrieveContactName($event->getEventData());
     $event->setMessageInformation(array('%s accepted you and is now in your eyeOS Network', array($username)));
     $event->setIsQuestion(false);
 }
Beispiel #15
0
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null) {
         throw new EyeInvalidArgumentException('You must specify the eventData property');
     }
     $eventData = $event->getEventData();
     if (!isset($eventData['userId']) || !is_string($eventData['userId'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'userId\']');
     }
     if (!isset($eventData['groupId']) || !is_string($eventData['groupId'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'groupId\']');
     }
     $userId = $eventData['userId'];
     $wGroupId = $eventData['groupId'];
     $wGroupName = GroupsEventHandler::retrieveWorkgroupName($wGroupId);
     if ($userId == $event->getReceiver()) {
         $event->setMessageInformation(array('You now are a memberof the group %s.', array($wGroupName)));
     } else {
         $userName = GroupsEventHandler::retrieveContactName($userId);
         $event->setMessageInformation(array('User %s is now member of your group %s.', array($userName, $wGroupName)));
     }
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null) {
         throw new EyeInvalidArgumentException('You must specify the eventData property');
     }
     $eventData = $event->getEventData();
     if (!isset($eventData['listId']) || !is_int($eventData['listId'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'listId\']');
     }
     if (!isset($eventData['listName']) || !is_string($eventData['listName'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'listName\']');
     }
     $listName = $eventData['listName'];
     $event->setMessageInformation(array('The list %s was deleted from People', array($listName)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null) {
         throw new EyeInvalidArgumentException('Missing or invalid eventData property');
     }
     $eventData = $event->getEventData();
     if (!isset($eventData['oldListName']) || !is_string($eventData['oldListName'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'oldListName\']');
     }
     if (!isset($eventData['newListName']) || !is_string($eventData['newListName'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'newListName\']');
     }
     $oldName = $eventData['oldListName'];
     $newName = $eventData['newListName'];
     $event->setMessageInformation(array('New name for %s list is %s.', array($oldName, $newName)));
     $event->setIsQuestion(false);
 }
 /**
  * Fill the properties of the event
  *
  * @param <AbstractEventNotification> $event
  */
 public function autoFill(AbstractEventNotification $event)
 {
     if ($event->getEventData() === null) {
         throw new EyeInvalidArgumentException('You must specify the eventData property');
     }
     $eventData = $event->getEventData();
     if (!isset($eventData['groupId']) || !is_string($eventData['groupId'])) {
         throw new EyeInvalidArgumentException('Missing or invalid $eventData[\'groupId\']');
     }
     $wGroupId = $eventData['groupId'];
     $wGroupName = GroupsEventHandler::retrieveWorkgroupName($wGroupId);
     $username = GroupsEventHandler::retrieveContactName($event->getSender());
     $event->setMessageInformation(array('User %s invited you in %s group.', array($username, $wGroupName)));
     $event->setIsQuestion(true);
     $event->setQuestion('Do you want to confirm?');
     $event->setAvailableAnswers('Confirm#Cancel');
 }