Beispiel #1
0
 public function testUserCanUseAccentedCharactersWhenEditing()
 {
     $project = new C3op_Projects_Project();
     $project->SetTitle("some title");
     $this->projectMapper->insert($project);
     $id = $project->GetId();
     $form = new C3op_Form_ProjectEdit();
     $formData = array('id' => $id, 'title' => 'I scream, you scream, we still scream to icecream and úÀÇÃêã é or ç?!?!?...;- yeah!', 'dateBegin' => '', 'value' => '', 'submit' => true);
     $form->process($formData);
 }
Beispiel #2
0
 public function editAction()
 {
     $form = new C3op_Form_ProjectEdit();
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         $postData = $this->getRequest()->getPost();
         if ($form->isValid($postData)) {
             $form->process($postData);
             $this->_helper->getHelper('FlashMessenger')->addMessage('The record was successfully updated.');
             $this->_redirect('/projects/project/success-create');
         } else {
             throw new C3op_Projects_ProjectException("A project must have a valid title.");
         }
     } else {
         // GET
         $thisProject = $this->InitProjectWithCheckedId($this->projectMapper);
         $id = $this->checkIdFromGet();
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'id', $id);
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'title', $thisProject->GetTitle());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'client', $thisProject->GetClient());
         $this->PopulateClientField($form, $thisProject->GetClient());
         $this->PopulateOurResponsibleField($form, $thisProject->GetOurResponsible());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'responsibleAtClient', $thisProject->GetResponsibleAtClient());
         $this->SetDateValueToFormField($form, 'beginDate', $thisProject->GetBeginDate());
         $this->SetDateValueToFormField($form, 'finishDate', $thisProject->GetFinishDate());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'value', $thisProject->GetValue());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'status', $thisProject->GetStatus());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'contractNature', $thisProject->GetContractNature());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'areaActivity', $thisProject->GetAreaActivity());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'overhead', $thisProject->GetOverhead());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'managementFee', $thisProject->GetManagementFee());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'object', $thisProject->GetObject());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'summary', $thisProject->GetSummary());
         C3op_Util_FormFieldValueSetter::SetValueToFormField($form, 'observation', $thisProject->GetObservation());
     }
 }