コード例 #1
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();
     }
 }
コード例 #2
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);
 }
コード例 #3
0
 /**
  * @param \Icap\DropzoneBundle\Entity\Dropzone $dropzone
  * @param \Icap\DropzoneBundle\Entity\Drop $drop
  */
 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
 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()), 'icap_dropzone');
         $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();
 }
コード例 #5
0
 /**
  * @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);
 }
コード例 #6
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);
 }
コード例 #7
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);
 }
コード例 #8
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);
 }
コード例 #9
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);
 }
コード例 #10
0
 /**
  * @param Dropzone  $dropzone
  * @param mixed     $dropzoneChangeSet
  * @param Criterion $criterion
  */
 public function __construct(Dropzone $dropzone, $dropzoneChangeSet, Criterion $criterion)
 {
     $details = array('dropzone' => array('id' => $dropzone->getId(), 'changeSet' => $dropzoneChangeSet), 'criterion' => array('id' => $criterion->getId(), 'instruction' => $criterion->getInstruction()));
     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)
 {
     $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);
 }
コード例 #12
0
 private function createAgendaEventDrop($startDate, $endDate, $user, Dropzone $dropzone, $type = 'drop')
 {
     $event = new Event();
     $event->setStart($startDate->getTimeStamp());
     $event->setEnd($endDate->getTimeStamp());
     $event->setUser($user);
     $dropzoneName = $dropzone->getResourceNode()->getName();
     if ($type == 'drop') {
         $title = $this->get('translator')->trans('Deposit phase of the %dropzonename% evaluation', array('%dropzonename%' => $dropzoneName), 'icap_dropzone');
         $desc = $this->get('translator')->trans('Evaluation %dropzonename% opening', array('%dropzonename%' => $dropzoneName), 'icap_dropzone');
         $event->setTitle($title);
         $event->setDescription($desc);
     } else {
         $title = $this->get('translator')->trans('Peer Review is starting in %dropzonename% evaluation', array('%dropzonename%' => $dropzoneName), 'icap_dropzone');
         $desc = $this->get('translator')->trans('Peer Review is starting in %dropzonename% evaluation', array('%dropzonename%' => $dropzoneName), 'icap_dropzone');
         $event->setTitle($title);
         $event->setDescription($desc);
     }
     $em = $this->getDoctrine()->getManager();
     $em->persist($event);
     $em->flush();
     return $event;
 }
コード例 #13
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);
 }
コード例 #14
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);
 }