/**
  * 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 page labels in XML format...
     // NOTE: use this location to update any label tags ...
     // $name = $user->getName();
     // $this->labels->setLabelTag( '[Title]', '[userName]', $name);
     // temporarily reset the form values so the defaults show up properly in the jumplists
     $this->formValues['week_id'] = $this->linkValues['weekJumpLink'] . $this->week_id;
     $this->formValues['campus_id'] = $this->linkValues['campusJumpLink'] . $this->campus_id;
     // NOTE:  this parent method prepares the $this->template with the
     // common Form data.
     $this->prepareTemplate($path);
     /*
      * Form related Template variables:
      */
     // store the button label
     $this->template->set('buttonText', $this->labels->getLabel('[Update]'));
     // Insert the date start/end values for the following date fields:
     // example:
     //$this->template->set( 'startYear_[fieldName]', 2000);
     //$this->template->set( 'endYear_[fieldName]', 2010);
     /*
      * Add any additional data required by the template here
      */
     // week list
     $jumpLink = $this->linkValues['weekJumpLink'];
     $weekManager = new RowManager_WeekManager();
     $weekManager->setSortOrder('week_endDate');
     $weekList = new ListIterator($weekManager);
     $jumpList = $weekList->getDropListArray(null, $jumpLink);
     $this->template->set('list_week_id', $jumpList);
     // campus list
     $jumpLink = $this->linkValues['campusJumpLink'];
     $campusArray = array();
     $this->campusListIterator->setFirst();
     while ($this->campusListIterator->moveNext()) {
         $campusObject = $this->campusListIterator->getCurrent(new RowManager_CampusManager());
         $campusArray[$jumpLink . $campusObject->getID()] = $campusObject->getLabel();
     }
     // echo '<pre>'.print_r($campusArray, true ).'</pre>';
     $this->template->set('list_campus_id', $campusArray);
     // add the definitions at the bottom of the page
     /*$defsContent = new Template($this->pathModuleRoot.'templates/');
       $a = $defsContent->fetch( 'moreDefs.tpl.php'  );
       $this->template->set( 'footerContent', $a );*/
     // uncomment this line if you are creating a template for this page
     //$templateName = 'page_StaffAdditionalWeeklyStats.php';
     // otherwise use the generic admin box template
     $templateName = 'siteFormSingle.php';
     return $this->template->fetch($templateName);
 }
Exemplo n.º 2
0
 /**
  * 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);
     // temporarily reset the form values so the defaults show up properly in the jumplists
     $this->formValues['week_id'] = $this->linkValues['weekJumpLink'] . $this->week_id;
     $this->formValues['campus_id'] = $this->linkValues['campusJumpLink'] . $this->campus_id;
     // 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->morestats_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_MoreStatsManager::XML_NODE_NAME;
     $this->template->set('rowManagerXMLNodeName', $xmlNodeName);
     // store the primary key field name for the data being displayed
     $this->template->set('primaryKeyFieldName', 'morestats_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_MoreStatsManager();
     // echo 'This campus ID['.$this->campus_id.']<br/>';
     $dataAccessManager->setCampusID($this->campus_id);
     $dataAccessManager->setWeekID($this->week_id);
     $dataAccessManager->setSortOrder($this->sortBy);
     //        $this->dataList = new MoreStatsList( $this->sortBy );
     $this->dataList = $dataAccessManager->getListIterator();
     $this->template->setXML('dataList', $this->dataList->getXML());
     /*
      * Add any additional data required by the template here
      */
     // week list
     $jumpLink = $this->linkValues['weekJumpLink'];
     $weekManager = new RowManager_WeekManager();
     $weekManager->setSortOrder('week_endDate');
     $weekList = new ListIterator($weekManager);
     $jumpList = $weekList->getDropListArray(null, $jumpLink);
     $this->template->set('list_week_id', $jumpList);
     // for looking up the person_id of this staff member
     $staffManager = new RowManager_StaffManager($this->staff_id);
     // campus list
     $assignmentManager = new RowManager_AssignmentsManager();
     $assignmentManager->setPersonID($staffManager->getPersonID());
     $assignmentManager->setAssignmentStatusID(CA_STAFF);
     $multiTableManager = new MultiTableManager();
     $multiTableManager->addRowManager($assignmentManager);
     $campusManager = new RowManager_CampusManager();
     $campusManager->setSortOrder('campus_desc');
     $multiTableManager->addRowManager($campusManager, new JoinPair($campusManager->getJoinOnCampusID(), $assignmentManager->getJoinOnCampusID()));
     $jumpLink = $this->linkValues['campusJumpLink'];
     $campusList = $multiTableManager->getListIterator();
     $campusArray = array();
     $campusList->setFirst();
     while ($campusList->moveNext()) {
         $campusObject = $campusList->getCurrent(new RowManager_CampusManager());
         $campusArray[$jumpLink . $campusObject->getID()] = $campusObject->getLabel();
     }
     // echo '<pre>'.print_r($campusArray, true ).'</pre>';
     $this->template->set('list_campus_id', $campusArray);
     // method list
     $typeManager = new RowManager_ExposureTypeManager();
     $typeManager->setSortOrder('exposuretype_desc');
     $typeList = $typeManager->getListIterator();
     $typeArray = $typeList->getDropListArray();
     $this->template->set('list_exposuretype_id', $typeArray);
     $templateName = 'siteFormDataList.php';
     // if you are creating a custom template for this page then
     // replace $templateName with the following:
     //$templateName = 'page_MoreStats.php';
     return $this->template->fetch($templateName);
 }