/**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  */
 function getHTML()
 {
     // Uncomment the following line if you want to create a template
     // tailored for this page:
     //$path = $this->pathModuleRoot.'templates/';
     // Otherwise use the standard Templates for the site:
     $path = SITE_PATH_TEMPLATES;
     /*
      * store the link values
      */
     // example:
     // $this->linkValues[ 'view' ] = 'add/new/href/data/here';
     // store the link labels
     $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]');
     $this->linkLabels['del'] = $this->labels->getLabel('[Delete]');
     $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]');
     // $this->linkLabels[ 'view' ] = 'new link label here';
     /*
      * 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);
     /*
      * Update any label tags ...
      */
     // example:
     // $name = $user->getName();
     // $this->labels->setLabelTag( '[Title]', '[userName]', $name);
     // NOTE:  this parent method prepares the $this->template with the
     // common AdminBox data.
     $this->prepareTemplate($path);
     // Enable the 'Add' form for creating new reports
     $formLabel = 'New Report Name:';
     // TODO: replace with constant?
     $formFieldArray = explode(',', page_HrdbForms::DISPLAY_FIELDS);
     $formField = $formFieldArray[0];
     $formButtonText = 'Add Report';
     $this->template->set('addFormAction', $this->formAction);
     $this->template->set('addFormLabel', $formLabel);
     $this->template->set('addFormField', $formField);
     $this->template->set('addButtonText', $formButtonText);
     // store the statevar id to edit
     $this->template->set('editEntryID', $this->customfields_id);
     // store all the fields to the template
     $this->setFormFieldsToTemplate();
     /*
      * Form related Template variables:
      */
     /*
      * Insert the date start/end values for the following date fields:
      */
     // example:
     //$this->template->set( 'startYear_[fieldName]', 2000);
     //$this->template->set( 'endYear_[fieldName]', 2010);
     /*
      * List related Template variables :
      */
     // Store the XML Node name for the Data Access Field List
     $xmlNodeName = RowManager_CustomFieldsManager::XML_NODE_NAME;
     $this->template->set('rowManagerXMLNodeName', $xmlNodeName);
     // store the primary key field name for the data being displayed
     $this->template->set('primaryKeyFieldName', 'customfields_id');
     // store data list to the template
     // NOTE: we initialize it here to make sure we capture any new data
     // from a recent processData() call.
     $dataAccessManager = new RowManager_CustomFieldsManager();
     if ($this->report_id != '') {
         $dataAccessManager->setReportID($this->report_id);
     }
     $dataAccessManager->setSortOrder($this->sortBy);
     //        $this->dataList = new CustomFieldsList( $this->sortBy );
     $this->dataList = $dataAccessManager->getListIterator();
     $this->template->setXML('dataList', $this->dataList->getXML());
     /*
      * Add any additional data required by the template here
      */
     $report_manager = new RowManager_CustomReportsManager($this->report_id);
     $report_list = $report_manager->getListIterator();
     $reportArray = $report_list->getDropListArray();
     $this->template->set('list_report_id', $reportArray);
     $fields_manager = new RowManager_FormFieldManager();
     $fields_list = $fields_manager->getListIterator();
     //          $fieldsArray = $fields_list ->getDropListArray();
     $fieldsInfoArray = $fields_list->getDataList();
     $fieldsArray = array();
     foreach (array_keys($fieldsInfoArray) as $fields_id) {
         $record = current($fieldsInfoArray);
         $fields_desc = strip_tags($record['fields_desc']);
         // remove HTML tags
         $question_regex = '/[^]*[\\.\\?!:]*[A-Z]+[a-z\\s0-9%]+[?]{1}/';
         // example: ([0-9]{3})\-[0-9]{1,2}\-[0-9]{1,2} for YYYY-MM-DD
         $simple_question = '/[?]{1}/';
         if (preg_match($question_regex, $fields_desc, $matches) >= 1) {
             $fieldsArray[$fields_id] = $matches[0];
             //substr($fields_desc,$matches[0][1]);
         } else {
             if (preg_match($simple_question, $fields_desc, $matches) < 1) {
                 $fieldsArray[$fields_id] = $fields_desc;
             } else {
                 $fieldsArray[$fields_id] = 'ERROR: ' . $fields_desc;
             }
         }
         next($fieldsInfoArray);
     }
     $this->template->set('list_fields_id', $fieldsArray);
     $report_name = '';
     if ($this->report_id != '') {
         $reportContext = new RowManager_CustomReportsManager($this->report_id);
         $report_name = $reportContext->getReportName();
     }
     $this->template->set('subheading', $report_name);
     $templateName = 'siteAdminBox.php';
     // if you are creating a custom template for this page then
     // replace $templateName with the following:
     //$templateName = 'page_EditCustomReports.php';
     return $this->template->fetch($templateName);
 }
  * staffdirector_id [INTEGER]  The unique ID of the staff-to-director association
  * staff_id [INTEGER]  The ID of the staff to be associated with a director.
  * director_id [INTEGER]  The staff ID of the staff director supervising the staff member indicated in the "staff_id" field.
  */
 $StaffDirector = new RowManager_StaffDirectorManager();
 $StaffDirector->dropTable();
 $StaffDirector->createTable();
 /*
  * CustomReports Table
  *
  * The object that allows access and editing of custom report names.
  *
  * report_id [INTEGER]  The unique ID of the custom report.
  * report_name [STRING]  The name of the custom HRDB report.
  */
 $CustomReports = new RowManager_CustomReportsManager();
 $CustomReports->dropTable();
 $CustomReports->createTable();
 /*
  * CustomFields Table
  *
  * The object used to associate HRDB form fields with a custom-built report.
  *
  * customfields_id [INTEGER]  The unique id of this custom report to HRDB form field match-up.
  * report_id [INTEGER]  The ID of the associated custom report.
  * fields_id [INTEGER]  The HRDB form field that should be associated with a custom report.
  */
 $CustomFields = new RowManager_CustomFieldsManager();
 $CustomFields->dropTable();
 $CustomFields->createTable();
 /*
 /**
  * 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
     //$path = SITE_PATH_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]' );
     //         $this->linkLabels[ 'cont' ] = $this->labels->getLabel( '[Continue]');
     // $this->linkLabels[ 'view' ] = 'new link label here';
     $this->linkLabels['DownloadCustomReportCSV'] = $this->labels->getLabel('[DownloadCustomReportCSV]');
     // 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);
     $this->prepareTemplate($path);
     // Set the custom labels for the data columns
     $this->template->set('listLabels', $this->listLabels);
     //         $this->template->set( 'dataFieldList', $this->getFieldArray($this->customreport_id));
     // store the Row Manager's XML Node Name
     //         $this->template->set( 'rowManagerXMLNodeName', MultiTableManager::XML_NODE_NAME );
     $this->template->set('rowManagerXMLNodeName', $this->listManager->getRowManagerXMLNodeName());
     // Store the XML Node name for the Data Access Field List
     //         $xmlNodeName = $this->dataList->getRowManagerXMLNodeName();
     //         $this->template->set( 'rowManagerXMLNodeName', $xmlNodeName);
     // //         $xmlNodeName = RowManager_FormFieldValueManager::XML_NODE_NAME;
     // //         $this->template->set( 'rowManagerXMLNodeName', $xmlNodeName);
     //         $this->template->setXML( 'dataList', $this->dataList->getXML() );
     //
     // store the primary key field name for the data being displayed
     $this->template->set('primaryKeyFieldName', 'person_id');
     // disable the heading?
     $this->template->set('disableHeading', $this->disableHeading);
     // Set page sub-heading (i.e. activity type filter)
     if ($this->customreport_id != '') {
         $customReports = new RowManager_CustomReportsManager($this->customreport_id);
         $sub_heading = $customReports->getReportName();
         $this->template->set('subheading', $sub_heading);
     }
     /*
      *  Set up any additional data transfer to the Template here...
      */
     $person_manager = new RowManager_PersonManager();
     $person_list = $person_manager->getListIterator();
     $person_manager->setLabelTemplateLastNameFirstName();
     $personArray = $person_list->getDropListArray();
     /** Create and store download CSV link **/
     if ($this->is_blank_page == false) {
         $downloadLink = array();
         $downloadLink['DownloadCustomReportCSV'] = $this->linkValues['DownloadCustomReportCSV'];
         $this->template->set('linkLabels', $this->linkLabels);
         $this->template->set('downloadLink', $downloadLink);
     }
     $this->template->set('list_person_id', $personArray);
     //         $templateName = 'siteDataList_dynamic.php';
     // if you are creating a custom template for this page then
     // replace $templateName with the following:
     $templateName = 'page_ViewCustomReport.tpl.php';
     return $this->template->fetch($templateName);
 }