コード例 #1
0
 /**
  * @param Wiki         $wiki
  * @param Section      $section
  * @param Contribution $contribution
  */
 public function __construct(Document $document, Dropzone $dropzone, $userIds)
 {
     $this->document = $document;
     $this->dropzone = $dropzone;
     $this->type = $dropzone->getResourceNode()->getName();
     $this->userIds = $userIds;
     $this->details = array();
     // Récupération du nom et du prénom
     $this->firstName = $document->getSender()->getFirstName();
     $this->lastName = $document->getSender()->getLastName();
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
コード例 #2
0
 /**
  * @param Wiki         $wiki
  * @param Section      $section
  * @param Contribution $contribution
  */
 public function __construct(Dropzone $dropzone, $newstate, $userIds)
 {
     $this->dropzone = $dropzone;
     $this->newState = $dropzone->getResourceNode()->getName();
     $this->userIds = $userIds;
     $this->details = array();
     $this->userId = $dropzone->getDrops()[0]->getUser()->getId();
     // Récupération du nom et du prénom
     $this->firstName = $dropzone->getDrops()[0]->getUser()->getFirstName();
     $this->lastName = $dropzone->getDrops()[0]->getUser()->getLastName();
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
コード例 #3
0
 /**
  * @param \Innova\CollecticielBundle\Entity\Dropzone $dropzone
  * @param \Innova\CollecticielBundle\Entity\Drop     $drop
  *
  * @internal param \Innova\CollecticielBundle\Event\Log\Wiki $wiki
  * @internal param \Innova\CollecticielBundle\Event\Log\Section $section
  * @internal param \Innova\CollecticielBundle\Event\Log\Contribution $contribution
  */
 public function __construct(Dropzone $dropzone, Drop $drop)
 {
     $this->dropzone = $dropzone;
     $this->drop = $drop;
     $this->details = array('drop' => $drop, 'dropGrade' => $drop->getCalculatedGrade(), 'resultMax' => 20, 'dropzoneId' => $dropzone->getId(), 'dropId' => $drop->getId());
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
コード例 #4
0
 /**
  * @param Wiki $wiki
  * @param Section $section
  * @param Contribution $contribution
  */
 public function __construct(Dropzone $dropzone, Drop $drop, Correction $correction, $roleManager)
 {
     $this->dropzone = $dropzone;
     $this->role_manager = $roleManager;
     $this->details = array('report' => array('drop' => $drop, 'correction' => $correction, 'report_comment' => $correction->getReportComment(), 'dropzoneId' => $dropzone->getId(), 'dropId' => $drop->getId(), 'correctionId' => $correction->getId()));
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
コード例 #5
0
 /**
  * @param Dropzone $dropzone
  * @param $actionName
  * @throws AccessDeniedException
  */
 protected function isAllow(Dropzone $dropzone, $actionName)
 {
     $collection = new ResourceCollection(array($dropzone->getResourceNode()));
     if (false === $this->container->get('security.authorization_checker')->isGranted($actionName, $collection)) {
         throw new AccessDeniedException();
     }
 }
コード例 #6
0
 /**
  * @param Dropzone $dropzone
  */
 public function checkEditRight(Dropzone $dropzone)
 {
     $collection = new ResourceCollection(array($dropzone->getResourceNode()));
     if (false === $this->container->get('security.authorization_checker')->isGranted('EDIT', $collection)) {
         return false;
     }
     return true;
 }
コード例 #7
0
 private function getDropZoneHiddenDirectory(Dropzone $dropzone)
 {
     $em = $this->getDoctrine()->getManager();
     $hiddenDirectory = $dropzone->getHiddenDirectory();
     if ($hiddenDirectory === null) {
         $hiddenDirectory = new Directory();
         $name = $this->get('translator')->trans('Hidden folder for "%dropzoneName%"', array('%dropzoneName%' => $dropzone->getResourceNode()->getName()), 'innova_collecticiel');
         $hiddenDirectory->setName($name);
         $role = $this->getDoctrine()->getRepository('ClarolineCoreBundle:Role')->findManagerRole($dropzone->getResourceNode()->getWorkspace());
         $resourceManager = $this->get('claroline.manager.resource_manager');
         $resourceManager->create($hiddenDirectory, $resourceManager->getResourceTypeByName('directory'), $dropzone->getResourceNode()->getCreator(), $dropzone->getResourceNode()->getWorkspace(), $dropzone->getResourceNode()->getParent(), null, array('ROLE_WS_MANAGER' => array('open' => true, 'export' => true, 'create' => array(), 'role' => $role)));
         $dropzone->setHiddenDirectory($hiddenDirectory->getResourceNode());
         $em->persist($dropzone);
         $em->flush();
     }
     return $dropzone->getHiddenDirectory();
 }
 /**
  * @param Wiki $wiki
  * @param Section $section
  * @param Contribution $contribution
  */
 public function __construct(Dropzone $dropzone, $newstate, $userIds)
 {
     $this->dropzone = $dropzone;
     $this->newState = $newstate;
     $this->userIds = $userIds;
     $this->details = array('newState' => $newstate);
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
コード例 #9
0
 /**
  * @param Dropzone   $dropzone
  * @param Drop       $drop
  * @param Correction $correction
  */
 public function __construct(Dropzone $dropzone, Drop $drop, Correction $correction)
 {
     $documentsDetails = array();
     foreach ($drop->getDocuments() as $document) {
         $documentsDetails[] = $document->toArray();
     }
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'documents' => $documentsDetails, 'owner' => array('id' => $drop->getUser()->getId(), 'lastName' => $drop->getUser()->getLastName(), 'firstName' => $drop->getUser()->getFirstName(), 'username' => $drop->getUser()->getUsername())), 'correction' => $correction->toArray(false));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
コード例 #10
0
 /**
  * @param Dropzone $dropzone
  * @param Drop     $drop
  * @param string   $grade
  */
 public function __construct(Dropzone $dropzone, Drop $drop, $grade)
 {
     $documentsDetails = array();
     foreach ($drop->getDocuments() as $document) {
         $documentsDetails[] = $document->toArray();
     }
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'documents' => $documentsDetails, 'owner' => array('id' => $drop->getUser()->getId(), 'lastName' => $drop->getUser()->getLastName(), 'firstName' => $drop->getUser()->getFirstName(), 'username' => $drop->getUser()->getUsername())), 'result' => $grade, 'resultMax' => 20);
     parent::__construct($dropzone->getResourceNode(), $details);
 }
コード例 #11
0
 /**
  * @param Dropzone $dropzone
  * @param Drop     $drop
  * @param Document $document
  */
 public function __construct(Dropzone $dropzone, Drop $drop, Document $document)
 {
     $documentsDetails = array();
     foreach ($drop->getDocuments() as $document) {
         $documentsDetails[] = $document->toArray();
     }
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'documents' => $documentsDetails), 'document' => $document->toArray());
     parent::__construct($dropzone->getResourceNode(), $details);
 }
コード例 #12
0
 /**
  * @param Wiki         $wiki
  * @param Section      $section
  * @param Contribution $contribution
  */
 public function __construct(Dropzone $dropzone, $newstate, $userIds)
 {
     $this->dropzone = $dropzone;
     $this->type = $dropzone->getResourceNode()->getName();
     $this->userIds = $userIds;
     // Traitement de la traduction pour CE cas. InnovaERV.
     if ($newstate == 'allowDrop') {
         $this->newState = 'Open';
     }
     if ($newstate == 'finished') {
         $this->newState = 'Closed';
     }
     $this->details = array('newState' => $this->newState);
     $this->userId = $dropzone->getDrops()[0]->getUser()->getId();
     // Récupération du nom et du prénom
     $this->firstName = $dropzone->getDrops()[0]->getUser()->getFirstName();
     $this->lastName = $dropzone->getDrops()[0]->getUser()->getLastName();
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
コード例 #13
0
 /**
  * @param Dropzone $dropzone
  * @param Drop $drop
  * @param $roleManager
  */
 public function __construct(Dropzone $dropzone, Drop $drop, $roleManager)
 {
     $this->dropzone = $dropzone;
     $this->role_manager = $roleManager;
     $documentsDetails = array();
     foreach ($drop->getDocuments() as $document) {
         $documentsDetails[] = $document->toArray();
     }
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'documents' => $documentsDetails));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
 /**
  * @param Wiki $wiki
  * @param Section $section
  * @param Contribution $contribution
  */
 public function __construct(Document $document, Dropzone $dropzone, $userIds)
 {
     //        $this->resourceNodeId = $dropzone->getDrops()[0]->getUser()->getId();
     //        $dropId = $document->getDrop()->getId(); //->getDropzone()->getId();
     //var_dump($dp);
     //var_dump($document);die();
     $this->document = $document;
     $this->type = $dropzone->getResourceNode()->getName();
     $this->userIds = $userIds;
     //echo "<pre>";
     //var_dump($this->userIds);
     //echo "</pre>";
     //die();
     $this->details = array();
     // Récupération du nom et du prénom
     $this->firstName = $document->getSender()->getFirstName();
     $this->lastName = $document->getSender()->getLastName();
     //var_dump($this->firstName);
     //var_dump($this->lastName);
     //var_dump($this->type);
     //die();
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
コード例 #15
0
 /**
  * @param Wiki         $wiki
  * @param Section      $section
  * @param Contribution $contribution
  */
 public function __construct(Document $document, Dropzone $dropzone, $userIds)
 {
     $this->document = $document;
     // Traitement du paramètre "type" : gestion du cas spécifique du type URL.
     if ($document->getType() == 'url') {
         $this->type = $document->getUrl();
     } elseif (strlen($document->getTitle()) > 0) {
         $this->type = $document->getTitle();
     } else {
         $this->type = $document->getResourceNode()->getName();
     }
     $this->userIds = $userIds;
     $this->details = array();
     // Récupération du nom et du prénom
     $this->firstName = $document->getSender()->getFirstName();
     $this->lastName = $document->getSender()->getLastName();
     parent::__construct($dropzone->getResourceNode(), $this->details);
 }
コード例 #16
0
 /**
  * @param Dropzone $dropzone
  * @param Drop     $drop
  * @param Document $document
  */
 public function __construct(Dropzone $dropzone, Drop $drop, Document $document)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId(), 'owner' => array('id' => $drop->getUser()->getId(), 'lastName' => $drop->getUser()->getLastName(), 'firstName' => $drop->getUser()->getFirstName(), 'username' => $drop->getUser()->getUsername())), 'document' => $document->toArray());
     parent::__construct($dropzone->getResourceNode(), $details);
 }
コード例 #17
0
 /**
  * @Route(
  *      "/{documentId}/add/comments/{userId}/{dropzoneId}/{correctionId}",
  *      name="innova_collecticiel_add_comment",
  *      requirements={"documentId" = "\d+", "userId" = "\d+", "dropzoneId" = "\d+", "correctionId" = "\d+"}
  * )
  * @ParamConverter("document", class="InnovaCollecticielBundle:Document", options={"id" = "documentId"})
  * @ParamConverter("user",class="ClarolineCoreBundle:User",options={"id" = "userId"})
  * @ParamConverter("dropzone", class="InnovaCollecticielBundle:Dropzone", options={"id" = "dropzoneId"})
  * @ParamConverter("correction", class="InnovaCollecticielBundle:Correction", options={"id" = "correctionId"})
  * @Method("POST")
  * @Template()
  */
 public function AddCommentsInnovaAction(Document $document, User $user, Dropzone $dropzone, Correction $correction)
 {
     $em = $this->getDoctrine()->getManager();
     // Valorisation du commentaire
     $comment = new Comment();
     $comment->setDocument($document);
     $comment->setUser($user);
     $form = $this->get('form.factory')->createBuilder(new CommentType(), $comment)->getForm();
     // Récupération de la saisie du commentaire
     $request = $this->get('request');
     if ($request->isMethod('POST')) {
         $form->handleRequest($request);
         if ($form->isValid()) {
             $em = $this->getDoctrine()->getManager();
             // Insertion en base du commentaire
             $em->persist($comment);
             $em->flush();
             // Envoi notification. InnovaERV
             $usersIds = [];
             $usersIds[] = $dropzone->getResourceNode()->getCreator()->getId();
             $usersIds[] = $document->getSender()->getId();
             $event = new LogDropzoneAddCommentEvent($dropzone, $dropzone->getManualState(), $usersIds, $comment);
             $this->get('event_dispatcher')->dispatch('log', $event);
         }
     }
     // Ajouter la création du log de la création du commentaire. InnovaERV.
     $unitOfWork = $em->getUnitOfWork();
     $unitOfWork->computeChangeSets();
     $dropzoneChangeSet = $unitOfWork->getEntityChangeSet($dropzone);
     $event = new LogCommentCreateEvent($dropzone, $dropzoneChangeSet, $comment);
     $this->dispatch($event);
     // Redirection vers la page des commentaires. InnovaERV.
     return $this->redirect($this->generateUrl('innova_collecticiel_drops_detail_comment', ['resourceId' => $dropzone->getId(), 'state' => 'edit', 'correctionId' => $correction->getId(), 'documentId' => $document->getId()]));
 }
コード例 #18
0
 /**
  * @param Dropzone  $dropzone
  * @param Criterion $criterion
  */
 public function __construct(Dropzone $dropzone, Criterion $criterion)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'criterion' => array('id' => $criterion->getId(), 'instruction' => $criterion->getInstruction()));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
コード例 #19
0
 /**
  * @param Dropzone $dropzone
  * @param array    $changeSet
  */
 public function __construct(Dropzone $dropzone, $changeSet)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId(), 'changeSet' => $changeSet));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
コード例 #20
0
 /**
  * @param Dropzone    $dropzone
  * @param mixed       $dropzoneChangeSet
  * @param CommentRead $comment_read
  */
 public function __construct(Dropzone $dropzone, $dropzoneChangeSet, CommentRead $comment_read)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId(), 'changeSet' => $dropzoneChangeSet), 'comment_read' => array('id' => $comment_read->getId(), 'comment' => $comment_read->getComment(), 'user' => $comment_read->getUser()));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
コード例 #21
0
 private function createAgendaEventDrop(User $user, Dropzone $dropzone)
 {
     $translator = $this->container->get('translator');
     $em = $this->container->get('doctrine')->getEntityManager();
     $event = new Event();
     $event->setStart($dropzone->getStartAllowDrop());
     $event->setEnd($dropzone->getEndAllowDrop());
     $event->setUser($user);
     $dropzoneName = $dropzone->getResourceNode()->getName();
     $title = $translator->trans('Deposit phase of the %dropzonename% evaluation', array('%dropzonename%' => $dropzoneName), 'innova_collecticiel');
     $desc = $translator->trans('Evaluation %dropzonename% opening', array('%dropzonename%' => $dropzoneName), 'innova_collecticiel');
     $event->setTitle($title);
     $event->setDescription($desc);
     $em->persist($event);
     $em->flush();
     return $event;
 }
コード例 #22
0
 /**
  * @param Dropzone $dropzone
  * @param Drop $drop
  */
 public function __construct(Dropzone $dropzone, Drop $drop)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId()), 'drop' => array('id' => $drop->getId()));
     parent::__construct($dropzone->getResourceNode(), $details);
 }
コード例 #23
0
 private function createAgendaEventDrop(DateTime $startDate, DateTime $endDate, $user, Dropzone $dropzone, $type = "drop")
 {
     /*
     $dateTS = new DateTime();
     $dateTS = $startDate;
     echo "TS : " . $dateTS;
     echo "TS = " . $dateTS->getTimestamp();
     */
     $event = new Event();
     $event->setStart($startDate);
     $event->setEnd($endDate);
     $event->setUser($user);
     $dropzoneName = $dropzone->getResourceNode()->getName();
     if ($type == 'drop') {
         $title = $this->get('translator')->trans('Deposit phase of the %dropzonename% evaluation', array('%dropzonename%' => $dropzoneName), 'innova_collecticiel');
         $desc = $this->get('translator')->trans('Evaluation %dropzonename% opening', array('%dropzonename%' => $dropzoneName), 'innova_collecticiel');
         $event->setTitle($title);
         $event->setDescription($desc);
     } else {
         $title = $this->get('translator')->trans('Peer Review is starting in %dropzonename% evaluation', array('%dropzonename%' => $dropzoneName), 'innova_collecticiel');
         $desc = $this->get('translator')->trans('Peer Review is starting in %dropzonename% evaluation', array('%dropzonename%' => $dropzoneName), 'innova_collecticiel');
         $event->setTitle($title);
         $event->setDescription($desc);
     }
     $em = $this->getDoctrine()->getManager();
     $em->persist($event);
     $em->flush();
     return $event;
 }