* meas_name [STRING] the name of the Measurement Type * meas_desc [STRING] The Measurement Type description */ $MeasurementType = new RowManager_MeasureTypeManager(); $MeasurementType->dropTable(); $MeasurementType->createTable(); /* * Scope Table * * stores a statistic scope (i.e. Ministry, Region, etc) * * scope_id [INTEGER] the object's unique identifier * scope_name [STRING] the name of the Scope * scope_reftable [STRING] the particular scope's reference table (i.e. p2c_stats_ministry) */ $Scope = new RowManager_ScopeManager(); $Scope->dropTable(); $Scope->createTable(); /* * ReportCalculation Table * * A calculation that can be included in a stats report (i.e. SUM, AVG, etc) * * filter_id [INTEGER] the unique id of this filter/calculation * filter_name [STRING] the Filter/Calculation name * filter_desc [STRING] Description for this Calculation/Filter */ $ReportCalculation = new RowManager_ReportFilterManager(); $ReportCalculation->dropTable(); $ReportCalculation->createTable(); /*
/** * 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; // temporarily reset the form values so the defaults show up properly in the jumplists $this->formValues['scope_id'] = $this->linkValues['scopeJumpLink'] . $this->scope_id; /* * 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); // store the statevar id to edit $this->template->set('editEntryID', $this->statistic_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ $jumpLink = $this->linkValues['scopeJumpLink']; $scope = new RowManager_ScopeManager(); // $scope->setScopeID( $this->scope_id ); $scope->setSortOrder('scope_id'); $scopeList = new ListIterator($scope); $scopeArray = $scopeList->getDropListArray(null, $jumpLink); //added jumplink $this->template->set('list_scope_id', $scopeArray); /*** USE JUMP/CHANGE-LIST TO GET THE CHOSEN SCOPE ID ***/ /** THEN CREATE A DROP-LIST WITH APPROPRIATE VALUES (i.e. Regions for scope 'Region') **/ // switch (SCOPE) $scopeRefs = $this->scope_ref_manager; //new RowManager_ScopeManager(); // $scope->setScopeID( $this->scope_id ); // $scope->setSortOrder( 'scope_id' ); $scopeRefsList = new ListIterator($scopeRefs); $scopeRefsArray = $scopeRefsList->getDropListArray(); $this->template->set('list_scope_ref_id', $scopeRefsArray); $statDataType = new RowManager_StatDataTypeManager(); $statDataType->setSortOrder('statistic_type_id'); $statDataTypeList = new ListIterator($statDataType); $dataTypes = $statDataTypeList->getDropListArray(); $this->template->set('list_statistic_type_id', $dataTypes); $freqType = new RowManager_FreqTypeManager(); $freqType->setFreqID($this->freq_id); $freqType->setSortOrder('freq_id'); $freqTypeList = new ListIterator($freqType); $freqTypeArray = $freqTypeList->getDropListArray(); $this->template->set('list_freq_id', $freqTypeArray); $measType = new RowManager_MeasureTypeManager(); $measType->setMeasureID($this->meas_id); $measType->setSortOrder('meas_id'); $measTypeList = new ListIterator($measType); $measTypeArray = $measTypeList->getDropListArray(); $this->template->set('list_meas_id', $measTypeArray); /* * 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_StatisticManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'statistic_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_StatisticManager(); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new StatisticList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ $templateName = 'page_EditStatistic.tpl.php'; //'siteFormDataList.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditStatistic.php'; return $this->template->fetch($templateName); }