Beispiel #1
0
 public function addtaskAction()
 {
     $this->view->pageTitle = $this->translate('user_addtask_headline');
     $this->view->form = new User_Form_EditTask(array(), true);
     $req = $this->getRequest();
     if ($req->isPost()) {
         // there are profile updates
         if ($this->view->form->isValid($_POST)) {
             $values = $this->view->form->getValues();
             $t = new User_Model_Task();
             $t->name = $values['taskname'];
             $t->save();
             $this->session->message = $this->translate('user_admin_taskadd_success');
             $this->_helper->redirector->gotoSimple('tasks', 'admin', 'user');
         } else {
             $this->view->message = $this->translate('user_admin_taskadd_failed');
         }
     }
 }