Esempio n. 1
0
 public function savePlace(\Nette\Forms\Controls\Button $button)
 {
     $form = $button->getForm();
     $values = $form->getValues();
     $place = $this->context->createServicePlaces()->wherePrimary($values->id);
     $place->update($values);
     $this->presenter->flashMessage('Done', 'success');
     $cache = new Cache($this->context->getService('cacheStorage'));
     $cache->clean(array(Cache::TAGS => array('subject', 'subjects', 'place', 'places')));
     if ($this->presenter->isAjax()) {
         $this->redrawControl('content');
         $this->presenter->redrawControl('flash');
     } else {
         $this->redirect('this');
     }
 }
Esempio n. 2
0
 public function formInviteCollaboratorBtnAdminClicked(Button $button)
 {
     $values = $button->getForm()->getValues();
     $id = $values->id;
     $user = $this->context->userFacade->find($id);
     $level = Access::ADMIN;
     $access = $this->context->projectFacade->addCollaboratorToProject($user, $this->project, $level);
     $this->log($this->project, Activity::ADD_COLLABORATOR, $access);
     $this->flash(sprintf('User <strong>%s</strong> has been added to project %s as %s', $user->getNick(), $this->project->getCaption(), $level));
     $this->redirect('this');
 }
Esempio n. 3
0
 public function goBack(Button $button)
 {
     $this->redirect('place', array('id' => $button->getForm()->getValues()->id));
 }