コード例 #1
0
     * 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();
    /*
     * StatDataType Table
     *
     * Stores a data type for a statistic (i.e. 'numeric')
     *
     * statistic_type_id [INTEGER]  unique id for the data type
     * statistic_type [STRING]  the statistic data type (i.e. 'numeric')
     */
    $StatDataType = new RowManager_StatDataTypeManager();
    $StatDataType->dropTable();
    $StatDataType->createTable();
    /*[RAD_DAOBJ_TABLE]*/
} else {
    echo 'Skipping Tables ... <br>';
}
// end if !skipTables
// check to see if parameter 'skipLabel' was provided
$skipLabel = isset($_REQUEST['skipLabel']);
// if not, then add labels to DB ...
if (!$skipLabel) {
    /*
     *  Insert Labels in DB
     */
    // Create Application Upload Series
コード例 #2
0
 protected function getFormFieldTypes($scopeRefList, $freqID = '', $measID = '')
 {
     $fieldTypes = '';
     $typesArray = $this->getFieldArray($scopeRefList, $freqID, $measID);
     // 	    echo "<br>types field array = <pre>".print_r($typesArray,true)."</pre>";
     // get types to match stat type ids
     $stat_types = new RowManager_StatDataTypeManager();
     $typesList = $stat_types->getListIterator();
     $statDataTypesArray = $typesList->getDataList();
     // go through results and store field types
     reset($typesArray);
     foreach (array_keys($typesArray) as $k) {
         $fieldValue = current($typesArray);
         $fieldTypes .= $this->getFormObject($statDataTypesArray[$fieldValue['statistic_type_id']]['statistic_type']) . ',';
         // $fieldValue['statistic_type']
         $fieldTypes .= 'droplist,';
         // used for stat-related freq value field
         next($typesArray);
     }
     // 'hidden,hidden,hidden';	//
     $fieldTypes = substr($fieldTypes, 0, -1);
     // remove final comma
     // 		echo "<br>Field Types = ".$fieldTypes;
     return $fieldTypes;
     // return list of form field types associated with event-specific fields
 }
コード例 #3
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;
     // 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);
 }