Beispiel #1
0
 public function execute($dataContainer)
 {
     parent::entryPoint($dataContainer);
     if (isset($_POST['room']) && isset($_POST['host']) && isset($_POST['category'])) {
         $room = $this->_em->getRepository("DM:SystemRoom")->findOneByName($_POST['room']);
         $host = $this->_em->getRepository("DM:SystemUsers")->findOneById($_POST['host']);
         $cat = $this->_em->getRepository("DM:ElawaCategory")->findOneByName($_POST['category']);
         $times = $this->_em->getRepository("DM:ElawaMeeting")->findAll();
         foreach ($times as $time) {
             if ($time->getHost() == $host && $time->getCategory() == $cat) {
                 $time->setRoom($room);
             }
             $this->_em->persist($time);
         }
         $this->_em->flush();
     } else {
         if (isset($_POST['hostId'])) {
             $host = $this->_em->getReference('DM:SystemUsers', $_POST['hostId']);
             $this->sendHostMeetingData($host);
         } else {
             if (isset($_POST['meetingId'])) {
                 $meeting = $this->_em->getReference('DM:ElawaMeeting', $_POST['meetingId']);
                 $isDisabled = $_POST['isDisabled'] == 'true';
                 $meeting->setIsDisabled($isDisabled);
                 $this->_em->persist($meeting);
                 $this->_em->flush();
             } else {
                 $hosts = $this->getHosts();
                 $this->_smarty->assign('hosts', $hosts);
                 $this->displayTpl('changeDisableds.tpl');
             }
         }
     }
 }
Beispiel #2
0
 public function execute($dataContainer)
 {
     parent::entryPoint($dataContainer);
     $numDeleted = $this->clearMeetings();
     $numCreated = $this->generate();
     $this->_interface->dieSuccess('Die Sprechzeiten wurden erfolgreich erstellt. <br>' . 'Es wurden ' . $numDeleted . ' alte Sprechzeiten gelöscht und ' . $numCreated . ' neue erstellt.');
 }
Beispiel #3
0
 public function execute($dataContainer)
 {
     parent::entryPoint($dataContainer);
     if (isset($_POST['hostId'])) {
         $host = $this->_em->getReference('DM:SystemUsers', $_POST['hostId']);
         $this->sendHostMeetingData($host);
     } else {
         if (isset($_POST['meetingId'])) {
             $meeting = $this->_em->getReference('DM:ElawaMeeting', $_POST['meetingId']);
             $isDisabled = $_POST['isDisabled'] == 'true';
             $meeting->setIsDisabled($isDisabled);
             $this->_em->persist($meeting);
             $this->_em->flush();
         } else {
             $hosts = $this->getHosts();
             $this->_smarty->assign('hosts', $hosts);
             $this->displayTpl('changeDisableds.tpl');
         }
     }
 }