/**
  * 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
     // Disable form?
     //         if ($this->disableForm != true)
     //         {
     $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);
     // store the statevar id to edit
     $this->template->set('editEntryID', $this->staffactivity_id);
     $this->formValues['form_name'] = 'scheduledActivityForm';
     // store all the fields to the template
     $this->setFormFieldsToTemplate();
     /*
      * Form related Template variables:
      */
     // Disable form?
     if ($this->disableForm == true) {
         $this->template->set('disableForm', $this->disableForm);
     }
     /*
      * Insert the date start/end values for the following date fields:
      */
     // example:
     //$this->template->set( 'startYear_[fieldName]', 2000);
     //$this->template->set( 'endYear_[fieldName]', 2010);
     $this->template->set('startYear_staffactivity_startdate', 2000);
     $this->template->set('endYear_staffactivity_startdate', 2010);
     $this->template->set('startYear_staffactivity_enddate', 2000);
     $this->template->set('endYear_staffactivity_enddate', 2010);
     /*
      * List related Template variables :
      */
     // Store the XML Node name for the Data Access Field List
     $xmlNodeName = RowManager_StaffActivityManager::XML_NODE_NAME;
     $this->template->set('rowManagerXMLNodeName', $xmlNodeName);
     // store the primary key field name for the data being displayed
     $this->template->set('primaryKeyFieldName', 'staffactivity_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_StaffActivityManager();
     if ($this->form_start_date != '' && $this->form_end_date != '') {
         $dataAccessManager->constructSearchCondition('staffactivity_startdate', '>=', $this->form_start_date, true);
         $dataAccessManager->constructSearchCondition('staffactivity_enddate', '<=', $this->form_end_date, true);
     }
     //         if ($this->showOnlyVacation == true)
     // 		  {
     // 			  $dataAccessManager->setActivityTypeID('1'); // **HACK** activitytype set to vacation
     // 		  }
     if (count($this->activityTypesFilter) > 0) {
         $activityTypesList = implode(',', $this->activityTypesFilter);
         $dataAccessManager->addSearchCondition('activitytype_id in (' . $activityTypesList . ')');
         // 				$dataAccessManager->constructSearchCondition('activitytype_id','=',$activityTypesList, true);
     }
     $dataAccessManager->setPersonID($this->person_id);
     $dataAccessManager->setSortOrder($this->sortBy);
     //        $this->dataList = new StaffActivityList( $this->sortBy );
     $this->dataList = $dataAccessManager->getListIterator();
     // $dataAccessManager
     $this->template->setXML('dataList', $this->dataList->getXML());
     /*
      * Add any additional data required by the template here
      */
     $this->template->set('disableHeading', $this->disableHeading);
     $activitytype = new RowManager_ActivityTypeManager();
     //         if ($this->showOnlyVacation == true)
     // 		  {
     // 			  $activitytype->setActivityTypeID('1'); // **HACK** activitytype set to vacation
     // 		  }
     if (count($this->activityTypesFilter) > 0) {
         $activityTypesList = implode(',', $this->activityTypesFilter);
         if ($activityTypesList != '') {
             $activitytype->addSearchCondition('activitytype_id in (' . $activityTypesList . ')');
         }
     }
     $activitytype->setSortOrder('activitytype_desc');
     //         $activitytypeList = new ListIterator($activitytype);
     //         $activitytypeArray = $activitytypeList->getDropListArray();
     $activitytypeList = $activitytype->getListIterator();
     $activitytypeArray = $activitytypeList->getDataList();
     foreach (array_keys($activitytypeArray) as $key) {
         $record = current($activitytypeArray);
         $colorCode = $record['activitytype_color'];
         $eventDesc = $record['activitytype_desc'];
         $activitytypeArray[$key] = '<span style="color:' . $colorCode . ';">' . $eventDesc . '</span>';
         next($activitytypeArray);
     }
     $this->template->set('list_activitytype_id', $activitytypeArray);
     /* First check to see whether start date > end date
      * then check if date matches form date context 
      */
     if (isset($this->dateSwitchMessage)) {
         $this->template->set('date_error_msg', $this->dateSwitchMessage);
     } else {
         if (isset($this->dateContextMessage)) {
             $this->template->set('date_error_msg', $this->dateContextMessage);
         }
     }
     //         $templateName = 'siteAdminBox.php';
     // if you are creating a custom template for this page then
     // replace $templateName with the following:
     $this->template->set('formName', $this->formValues['form_name']);
     $templateName = 'page_EditStaffActivity.tpl.php';
     return $this->template->fetch($templateName);
 }