/** * function getHTML * <pre> * This method returns the HTML data generated by this object. * </pre> * @return [STRING] HTML Display data. */ function getHTML() { // Make a new Template object //$this->pathModuleRoot.'templates/'; // Replace $path with the following line if you want to create a // template tailored for this page: $path = $this->pathModuleRoot . 'templates/'; // store the link values // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['add'] = $this->labels->getLabel('[Add]'); // $this->linkLabels[ 'edit' ] = $this->labels->getLabel( '[Edit]' ); // $this->linkLabels[ 'del' ] = $this->labels->getLabel( '[Delete]' ); if (!isset($this->linkLabels['cont'])) { $this->linkLabels['cont'] = $this->labels->getLabel('[Back]'); // [Continue] } // $this->linkLabels[ 'view' ] = 'new link label here'; $this->prepareTemplate($path); // Set form approval status message // $form_approved = "Approval Pending"; // if ($this->is_form_approved == true) // { // $form_approved = "Form Approved"; // } // $this->template->set('form_approval_msg', $form_approved ); // // Display message if form has just been submitted if ($this->form_submitted == true) { $statusMessage = 'Form information successfully submitted.'; $this->template->set('form_status_msg', $statusMessage); $this->form_submitted = false; } // Set the sub-page objects $this->template->set('basicStaffForm', $this->generateTopForm()); if ($this->has_activity_form == true) { $this->template->set('scheduledActivityForm', $this->generateBottomForm()); } // Set approval form information $is_approved = ''; $approved_by = ''; $last_change = ''; $approval_array = $this->listManager->getDataList(); reset($approval_array); foreach (array_keys($approval_array) as $k) { $record = current($approval_array); $approved = $record['staffschedule_approved']; if ($approved == '1') { $is_approved = 'CHECKED'; } $approved_by = $record['staffschedule_approvedby']; $last_change = $record['staffschedule_lastmodifiedbydirector']; $approval_notes = $record['staffschedule_approvalnotes']; next($approval_array); } $personManager = new RowManager_PersonManager($approved_by); $personManager->setSortOrder('person_lname'); $personManager->setLabelTemplateLastNameFirstName(); $approved_by = $personManager->getPersonFirstName() . ' ' . $personManager->getPersonLastName(); // $personList = $personManager->getListIterator( ); // $personArray = $personList->getDropListArray( ); // $this->template->set( 'list_approved_by', $personArray ); $this->template->set('approvalFormAction', $this->formAction); $this->template->set('is_approved', $is_approved); $this->template->set('approvalButtonText', 'Approve/Disapprove'); $this->template->set('approval_notes', $approval_notes); $this->template->set('director_field', 'Last Change By'); $this->template->set('approved_by', $approved_by); $this->template->set('time_field', 'Last Change At'); if ($last_change != '') { $date_regex = '/[2-9]([0-9]{3})\\-[0-9]{1,2}\\-[0-9]{1,2}/'; if (preg_match($date_regex, $last_change) >= 1) { $time = strtotime($last_change); $last_change = strftime("%d %b %Y %H:%M:%S", $time); } } $this->template->set('last_change', $last_change); // $this->template->set('last_change', $last_change); // store any additional link Columns // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); // store the page labels // NOTE: use this location to update any label tags ... // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // store the Row Manager's XML Node Name // $this->template->set( 'rowManagerXMLNodeName', RowManager_RegistrationManager::XML_NODE_NAME ); $this->template->set('rowManagerXMLNodeName', MultiTableManager::XML_NODE_NAME); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'person_id'); // TODO: somehow merge the primary join with the balance owing join.... for efficiency /* * Set up any additional data transfer to the Template here... */ // $this->template->set( 'dataList', $this->dataList); // Get the real form name $form_name = ''; if ($this->form_id != '') { $formContext = new RowManager_StaffScheduleTypeManager($this->form_id); $form_name = $formContext->getFormName(); } // Get the person's name $person_name = ''; if ($this->person_id != '') { $personInfo = new RowManager_PersonManager($this->person_id); $person_name = $personInfo->getPersonFirstName() . ' ' . $personInfo->getPersonLastName(); } // $form_notice = 'Please note that the "Update" button only updates the top form.<br>The bottom form is updated via its own buttons/links.'; $this->template->set('heading', $form_name); $this->template->set('subheading', $person_name); // $this->template->set( 'formsNotice', $form_notice); $templateName = 'page_ApproveStaffSchedule.tpl.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditCampusRegistrations.php'; return $this->template->fetch($templateName); }
private function getPersonFullName() { $personManager = new RowManager_PersonManager($this->person_id); return $personManager->getPersonFirstName() . ' ' . $personManager->getPersonLastName(); }