Guest User

Untitled

a guest
Apr 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.23 KB | None | 0 0
  1.     public function renderShowDetail($id)
  2.     {
  3.         if ($id == NULL)
  4.         {
  5.             $form = $this['detailPersonForm'];
  6.             $form['delete']->setDisabled(TRUE);
  7.             $form->addSubmit('save', 'Save')
  8.                     ->onClick[] = array($this, 'detailPersonFormSubmittedSave');
  9.             Debug::log('ShowDetailForm (SAVE) loaded.', Debug::DEBUG);
  10.         }
  11.         else
  12.         {
  13.             $EID = $id;
  14.             $person = $this->personRepository->find($EID);
  15.             $formDefaults = array();
  16.             $formDefaults['EID'] = $person->ID;
  17.             $formDefaults['Surname'] = $person->Surname;
  18.             $formDefaults['Name'] = $person->Firstname;
  19.             $formDefaults['Group_ID'] = $person->GroupID;
  20.             $formDefaults['CostCenter'] = $person->CostCenterID;
  21.             $form = $this['detailPersonForm'];
  22.             $form['EID']->setAttribute('readonly', 'readonly');
  23.             $form->addSubmit('save', 'Save')
  24.                     ->onClick[] = array($this, 'detailPersonFormSubmittedUpdate');
  25.             $form->setDefaults($formDefaults);
  26.             Debug::log('ShowDetailForm (UPDATE) loaded.', Debug::DEBUG);
  27.         }
  28.         $this->template->form = $form;
  29.     }
Add Comment
Please, Sign In to add comment