Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function renderShowDetail($id)
- {
- if ($id == NULL)
- {
- $form = $this['detailPersonForm'];
- $form['delete']->setDisabled(TRUE);
- $form->addSubmit('save', 'Save')
- ->onClick[] = array($this, 'detailPersonFormSubmittedSave');
- Debug::log('ShowDetailForm (SAVE) loaded.', Debug::DEBUG);
- }
- else
- {
- $EID = $id;
- $person = $this->personRepository->find($EID);
- $formDefaults = array();
- $formDefaults['EID'] = $person->ID;
- $formDefaults['Surname'] = $person->Surname;
- $formDefaults['Name'] = $person->Firstname;
- $formDefaults['Group_ID'] = $person->GroupID;
- $formDefaults['CostCenter'] = $person->CostCenterID;
- $form = $this['detailPersonForm'];
- $form['EID']->setAttribute('readonly', 'readonly');
- $form->addSubmit('save', 'Save')
- ->onClick[] = array($this, 'detailPersonFormSubmittedUpdate');
- $form->setDefaults($formDefaults);
- Debug::log('ShowDetailForm (UPDATE) loaded.', Debug::DEBUG);
- }
- $this->template->form = $form;
- }
Add Comment
Please, Sign In to add comment