/**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @param $downloadType [STRING] Used to decide which file to overwrite with recent report
  * @param $eventID [STRING] Identifies the event to filter data by
  * @param $campusID [STRING] Identifies the campus to filter data by
  * @param $file_name_list [STRING] CSV list of possible file names (1 per download type)
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $downloadType, $eventID = '', $campusID = '', $file_name_list = '')
 {
     parent::__construct();
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     // overwrites data in a file determined by $reportType and located at SITE_PATH_REPORTS
     $this->storeReportData($downloadType, $eventID, $campusID, $file_name_list);
     $this->download_type = $downloadType;
     $this->event_id = $eventID;
     $this->campus_id = $campusID;
     //        $this->managerInit = $managerInit;
     /*
            $dataAccessObject = new RowManager_EventManager();
            // only display those rows that are supposed to be displayed on the home page
            $dataAccessObject->setOnHomePage( true );
            $dataAccessObject->setSortOrder( $sortBy );
     //        $this->listManager = new EventList( $sortBy );
            $this->listManager = $dataAccessObject->getListIterator();
     */
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_reg::MULTILINGUAL_SERIES_KEY;
     $pageKey = modulecim_reg::MULTILINGUAL_PAGE_FIELDS;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
     // then load the page specific labels for this page
     $pageKey = page_DownloadReport::MULTILINGUAL_PAGE_KEY;
     $this->labels->loadPageLabels($pageKey);
     $this->labels->setSeriesKey(SITE_LABEL_SERIES_SITE);
     $this->labels->loadPageLabels(SITE_LABEL_PAGE_FORM_LINKS);
 }
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $regionID = "", $semesterID = "")
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     $this->region_id = $regionID;
     if ($regionID == "") {
         // TODO set this properly
         $this->region_id = 1;
     }
     // echo 'regionID['.$this->region_id.']<br/>';
     $this->semester_id = $semesterID;
     if ($semesterID == "") {
         // TODO set this properly
         $this->semester_id = 10;
     }
     // echo 'semesterID['.$this->semester_id.']<br/>';
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_stats::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_RegionalSemesterReport::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
     // load the default fields
     $pageKey = modulecim_stats::MULTILINGUAL_PAGE_FIELDS;
     $this->labels->loadPageLabels($pageKey);
 }
Exemplo n.º 3
0
 /**
  * function __construct
  * <pre>
  * Initialize the PageDisplay Object.
  * </pre>
  * @param $formAction [STRING] The action on a form submit
  * @param $fieldList [STRING] The list of form fields to work with
  * @param $fieldDisplayTypes [STRING] The list of form field Types
  * @return [void]
  */
 function __construct($formAction, $fieldList, $fieldDisplayTypes)
 {
     // call the PageDisplay object's constructor
     parent::__construct();
     /*
      * initializing the Page's form variables
      */
     $this->formAction = $formAction;
     $this->formFieldDisplayTypes = $fieldDisplayTypes;
     // if a field list was provided then
     if ($fieldList != '') {
         // for each field item
         $items = explode(',', $fieldList);
         for ($indx = 0; $indx < count($items); $indx++) {
             // break item into it's parts: key,type,invalid value
             list($fieldKey, $fieldType, $fieldInvalid) = explode('|', $items[$indx]);
             // store in arrays ...
             $this->formFields[] = $fieldKey;
             $this->formFieldTypes[$fieldKey] = $fieldType;
             $this->formFieldInvalid[$fieldKey] = $fieldInvalid;
             $this->formFieldRequired[$fieldKey] = substr($fieldInvalid, 1, -1);
             $this->formErrors[$fieldKey] = '';
         }
         // next item
     } else {
         // else
         // initialize all arrays to empty
         $this->formFields = array();
         $this->formFieldTypes = array();
         $this->formFieldInvalid = array();
         $this->formErrors = array();
     }
     $this->formValues = array();
 }
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $staff_id, $campus_id = "", $semester_id = "")
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     $this->permManager = new PermissionManager($this->viewer->getViewerID());
     // for looking up the person_id of this staff member
     $this->staff_id = $staff_id;
     $staffManager = new RowManager_StaffManager($this->staff_id);
     // echo 'the staff_id['.$this->staff_id.']<br/>';
     // figure out what campuses to display
     $multiTableManager = new MultiTableManager();
     $campusManager = new RowManager_CampusManager();
     $campusManager->setSortOrder('campus_desc');
     $isRT = $this->permManager->isRegional();
     if ($isRT) {
         // get all the campuses across the country
         $multiTableManager->addRowManager($campusManager);
     } else {
         // get only the campuses the staff is assigned to
         $assignmentManager = new RowManager_AssignmentsManager();
         $this->person_id = $staffManager->getPersonID();
         $assignmentManager->setPersonID($this->person_id);
         $assignmentManager->setAssignmentStatusID(CA_STAFF);
         $multiTableManager->addRowManager($assignmentManager);
         $multiTableManager->addRowManager($campusManager, new JoinPair($campusManager->getJoinOnCampusID(), $assignmentManager->getJoinOnCampusID()));
     }
     $this->campusListIterator = $multiTableManager->getListIterator();
     if ($campus_id != '') {
         // echo 'campus_id is SET ['.$campus_id.']<br/>';
         $this->campus_id = $campus_id;
     } else {
         // set a default campus id
         // echo 'Choosing a default campus<br/>';
         $this->campusListIterator->setFirst();
         if ($this->campusListIterator->moveNext()) {
             $campusObject = $this->campusListIterator->getCurrent(new RowManager_CampusManager());
             $this->campus_id = $campusObject->getID();
         } else {
             die('ERROR - unable to set campus_id - page_StaffWeeklyReport');
         }
     }
     // echo 'the campus_id['.$this->campus_id.']<br/>';
     if ($semester_id != '') {
         $this->semester_id = $semester_id;
     } else {
         // set a default semester id
         $this->semester_id = 4;
         // TODO set this properly
     }
     // echo 'the semester_id['.$this->semester_id.']<br/>';
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_stats::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_CampusWeeklyStatsReport::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
 }
Exemplo n.º 5
0
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @return [void]
  */
 function __construct($formAction, $displayFieldList)
 {
     parent::__construct();
     $this->formAction = $formAction;
     $this->displayFields = $displayFieldList;
     $this->shouldDelete = false;
     $this->wasSubmitted = false;
 }
Exemplo n.º 6
0
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer)
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_hrdb::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_ImportData::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
 }
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @param $downloadType [STRING] Used to decide which file to overwrite with recent report
  * @param $eventID [STRING] Identifies the event to filter data by
  * @param $managerInit [INTEGER] Initialization value for the listManager.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $eventID = '')
 {
     parent::__construct();
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     // if viewer is NOT authenticated then
     if (!$this->viewer->isAuthenticated()) {
         // 	            // if the requested page wasn't PAGE_MODULE_LOGIN then
         // 	            if ( $this->moduleKey != PAGE_MODULE_LOGIN) {
         //
         // 	                // Store requested PageContent Module & QueryString info in Session CallBack
         // 	                // NOTE: I use SERVER_ADDR + SCRIPT_URL instead of SCRIPT_URI
         // 	                // since mac web servers tend to use rendezvous names which
         // 	                // means nothing on Windows systems ...
         // 	                $baseCallBack = $this->getBaseURL(). '?' .$_SERVER['QUERY_STRING'];
         // 	                $_SESSION[ SESSION_ID_CALLBACK ] = $baseCallBack;
         //
         // 	                $this->debug( 'Viewer NOT Authenticated.<br>Storing baseCallBack=['.$baseCallBack.']<br>' );
         //
         // 	                // set current PageContent Module to Login
         // 	                $this->moduleKey = PAGE_MODULE_LOGIN;
         //
         // 	            } // end if moduleKey != PAGE_MODULE_LOGIN
     }
     // end if
     // overwrites data in a file determined by $reportType and located at SITE_PATH_REPORTS
     $this->storeReportData($eventID);
     $this->event_id = $eventID;
     //        $this->managerInit = $managerInit;
     /*
            $dataAccessObject = new RowManager_EventManager();
            // only display those rows that are supposed to be displayed on the home page
            $dataAccessObject->setOnHomePage( true );
            $dataAccessObject->setSortOrder( $sortBy );
     //        $this->listManager = new EventList( $sortBy );
            $this->listManager = $dataAccessObject->getListIterator();
     */
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_reg::MULTILINGUAL_SERIES_KEY;
     $pageKey = modulecim_reg::MULTILINGUAL_PAGE_FIELDS;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
     // then load the page specific labels for this page
     $pageKey = page_DownloadAIARegReport::MULTILINGUAL_PAGE_KEY;
     $this->labels->loadPageLabels($pageKey);
     $this->labels->setSeriesKey(SITE_LABEL_SERIES_SITE);
     $this->labels->loadPageLabels(SITE_LABEL_PAGE_FORM_LINKS);
 }
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $viewerID = "")
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     $this->viewer_id = $this->viewer->getViewerID();
     $this->changedViewerID = $viewerID;
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = moduleAccountAdmin::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_PasswordChanged::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
 }
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $eventID, $recalcStatus = FinancialTools::RECALC_NOTNEEDED)
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     $this->event_id = $eventID;
     $this->recalcStatus = $recalcStatus;
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_reg::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_AdminEventHome::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
 }
Exemplo n.º 10
0
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer)
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_stats::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_StatsHome::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
     $this->isNational = false;
     $this->isRegional = false;
     $this->isCD = false;
     $this->isStatsCoordinator = false;
     $this->isAllStaff = false;
 }
Exemplo n.º 11
0
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $reg_id, $event_id, $person_id, $isInRegProcess = 'FALSE', $ministry_id = '')
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     $this->reg_id = $reg_id;
     $this->event_id = $event_id;
     $this->person_id = $person_id;
     $this->ministry_id = $ministry_id;
     // set campus_id later
     $this->is_in_reg_process = $isInRegProcess;
     $this->isShowingEvents = true;
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_reg::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_Reg_home::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
 }
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $formAction, $event_id, $person_id)
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     $this->person_id = $person_id;
     $this->event_id = $event_id;
     $this->formAction = $formAction;
     $this->displayFields = page_ConfirmCancelRegistration::DISPLAY_FIELDS;
     $this->shouldCancel = false;
     $this->wasSubmitted = false;
     // create the item Manager to display
     $regs = new RowManager_RegistrationManager();
     $regs->setPersonID($this->person_id);
     $regs->setEventID($this->event_id);
     $regList = $regs->getListIterator();
     $regArray = $regList->getDataList();
     reset($regArray);
     $record = current($regArray);
     // should be single record per person per event
     $this->reg_id = $record['registration_id'];
     // init. data manager object
     $this->itemManager = new RowManager_RegistrationManager($this->reg_id);
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_reg::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_ConfirmCancelRegistration::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
     // then load the page specific labels for this page
     $this->labels->loadPageLabels($pageKey);
     // add Site YES/NO labels
     $this->labels->setSeriesKey(SITE_LABEL_SERIES_SITE);
     $this->labels->loadPageLabels(SITE_LABEL_PAGE_LIST_YESNO);
 }
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer)
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulep2c_stats::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_GenericStatsHome::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
     // then load the page specific labels for this page
     $this->labels->loadPageLabels($pageKey);
     //         // load the site default form link labels
     $this->labels->setSeriesKey(SITE_LABEL_SERIES_SITE);
     $this->labels->loadPageLabels(SITE_LABEL_PAGE_FORM_LINKS);
     $this->labels->loadPageLabels(SITE_LABEL_PAGE_FORMERRORS);
     $this->isNational = false;
     $this->isRegional = false;
     $this->isCD = false;
     $this->isStatsCoordinator = false;
     $this->isAllStaff = false;
 }
Exemplo n.º 14
0
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @return [void]
  */
 function __construct($displayFieldList)
 {
     parent::__construct();
     $this->displayFields = $displayFieldList;
 }
Exemplo n.º 15
0
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $freq_id, $meas_id, $start_freqvalue_id, $end_freqvalue_id, $scope_ref_array, $stats_id_array, $filter_id_array)
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     //         $this->permManager = new PermissionManager( $this->viewer->getViewerID() );
     $this->freq_id = $freq_id;
     $this->meas_id = $meas_id;
     $this->scope_ref_array = $scope_ref_array;
     // initialize the freq values to display
     $this->freqValManager = new RowManager_FreqValueManager();
     $this->freqValManager->setFreqID($freq_id);
     $freqValRange = 'freqvalue_id between ' . $start_freqvalue_id . ' and ' . $end_freqvalue_id;
     $this->freqValManager->addSearchCondition($freqValRange);
     $this->freqValManager->setSortByDateTime();
     //          $this->freqValManager->setSortOrder('freqvalue_id');
     // initialize the statistics value RowManager to contain the values we want
     $this->dataManager = new RowManager_StatValueManager();
     // filter values by the statistics chosen in previous filter step
     $this->stats_id_array = $stats_id_array;
     $statFilter = '';
     reset($stats_id_array);
     foreach (array_keys($stats_id_array) as $key) {
         // TODO?: use is_numeric() on $scope_ref_list elements to determine that proper value exists
         $statFilter .= '(statistic_id = ' . current($stats_id_array) . ') OR ';
         next($stats_id_array);
     }
     $statFilter = substr($statFilter, 0, -4);
     // remove ' OR ' from the end of the string
     $this->dataManager->addSearchCondition($freqValRange);
     $this->dataManager->addSearchCondition($statFilter);
     $this->dataManager->setSortOrder('statistic_id');
     // Retrieve stats names to be displayed
     $statNames = new RowManager_StatisticManager();
     $statNames->addSearchCondition($statFilter);
     $statNames->setSortOrder('statistic_id');
     $this->stat_names_array = array();
     $statNamesList = $statNames->getListIterator();
     $statNamesArray = $statNamesList->getDataList();
     reset($statNamesArray);
     $i = 0;
     foreach (array_keys($statNamesArray) as $key) {
         $record = current($statNamesArray);
         $this->stat_names_array[$i] = $record['statistic_name'];
         next($statNamesArray);
         $i++;
     }
     //          echo "stat names array = <pre>".print_r($statNamesArray,true)."</pre>";
     // initialize the additional calculations to be made (i.e. SUM, AVG, etc)
     $this->calcManager = new RowManager_ReportFilterManager();
     $this->filter_id_array = $filter_id_array;
     $calcFilter = '';
     reset($filter_id_array);
     foreach (array_keys($filter_id_array) as $key) {
         // TODO?: use is_numeric() on $scope_ref_list elements to determine that proper value exists
         $calcFilter .= '(filter_id = ' . current($filter_id_array) . ') OR ';
         next($filter_id_array);
     }
     $calcFilter = substr($calcFilter, 0, -4);
     // remove ' OR ' from the end of the string
     $this->calcManager->addSearchCondition($calcFilter);
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulep2c_stats::MULTILINGUAL_SERIES_KEY;
     $pageKey = modulep2c_stats::MULTILINGUAL_PAGE_FIELDS;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
     $pageKey = page_StatsReport::MULTILINGUAL_PAGE_KEY;
     $this->labels->loadPageLabels($pageKey);
     //         echo "POST values = <pre>".print_r($_POST,true)."</pre>";
 }
Exemplo n.º 16
0
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @param $pathModuleRoot [STRING] The path to the module's root dir.
  * @param $viewer [OBJECT] The viewer object.
  * @return [void]
  */
 function __construct($pathModuleRoot, $viewer, $eventID, $recalcStatus = FinancialTools::RECALC_NOTNEEDED, $campus_link = '')
 {
     parent::__construct();
     // initialzie the object values
     $this->pathModuleRoot = $pathModuleRoot;
     $this->viewer = $viewer;
     $this->event_id = $eventID;
     $this->recalcStatus = $recalcStatus;
     // get privileges for the current viewer
     $privManager = new PrivilegeManager($this->viewer->getID());
     $regSummaries = new RegSummaryTools();
     //       	$is_campus_admin = false;
     if ($privManager->isBasicAdmin($this->event_id) == true) {
         /** Set the summary data headings (used only for generating PDF) **/
         $this->summary_headings = array();
         $this->summary_headings[0] = 'Campus';
         $this->summary_headings[1] = 'Admin';
         $this->summary_headings[2] = 'Males';
         $this->summary_headings[3] = 'Females';
         $this->summary_headings[4] = 'Total';
         $this->summary_headings[5] = 'Cancellations';
         $this->summary_headings[6] = 'Completed';
         $this->summary_headings[7] = 'Incomplete';
         /** RETRIEVE CAMPUS REGISTRATION SUMMARY DATA ***/
         //TODO?: put some/all of this into a helper method
         // initialized template arrays
         $campusLevelLinks = array();
         $this->summaryTotals = array();
         $this->summaryTotals['label'] = '';
         $this->summaryTotals['blank'] = '';
         // 'Registrations' link has no need for a total...
         $this->summaryTotals['numMales'] = 0;
         $this->summaryTotals['numFemales'] = 0;
         $this->summaryTotals['campusTotal'] = 0;
         $this->summaryTotals['cancellations'] = 0;
         $this->summaryTotals['completes'] = 0;
         $this->summaryTotals['incompletes'] = 0;
         /* Get all campuses (affiliated with the admin's country) */
         // 	     		$campuses = new RowManager_CampusManager();
         // 	     		$campuses->setSortOrder('campus_desc');
         // 	     		$campusList = $campuses->getListIterator();
         // 	     		$campusArray = $campusList->getDataList();
         $country_campuses = new MultiTableManager();
         $events = new RowManager_EventManager();
         $events->setEventID($this->event_id);
         $campuses = new RowManager_CampusManager();
         $regions = new RowManager_RegionManager();
         $countries = new RowManager_CountryManager();
         $country_campuses->addRowManager($campuses);
         $country_campuses->addRowManager($regions, new JoinPair($regions->getJoinOnRegionID(), $campuses->getJoinOnRegionID()));
         $country_campuses->addRowManager($countries, new JoinPair($countries->getJoinOnCountryID(), $regions->getJoinOnCountryID()));
         $country_campuses->addRowManager($events, new JoinPair($events->getJoinOnCountryID(), $countries->getJoinOnCountryID()));
         $country_campuses->setSortOrder('campus_desc');
         $countryList = $country_campuses->getListIterator();
         $campusArray = $countryList->getDataList();
         reset($campusArray);
         // 	     		echo 'campus array = <pre>'.print_r($campusArray,true).'</pre>';
         /** JANUARY 25, 2008    (HSMIT) added $campusList to all getCampusRegistrations() calls below
                                         to match registration campuses with event-affliated country's campus list 
                                         
             ALSO: had to add somewhat redundant pre-processing to get campus list **/
         $campusList = '';
         foreach (array_keys($campusArray) as $key) {
             $record = current($campusArray);
             $campusList .= $record['campus_id'] . ',';
             // populate CSV for registrations filter
             next($campusArray);
         }
         $campusList = substr($campusList, 0, -1);
         reset($campusArray);
         // retrieve cancellations (for current event)
         $results_cancelled = array();
         $results_cancelled = $regSummaries->getCampusRegistrations($this->event_id, '', true, $campusList);
         // retrieve total registrations and total females registered (for current event)
         $results = array();
         $results_female = array();
         $results = $regSummaries->getCampusRegistrations($this->event_id, '', false, $campusList);
         $results_female = $regSummaries->getCampusRegistrations($this->event_id, 'female', false, $campusList);
         // retrieve total complete registrations and total incomplete registrations (for current event)
         $results_complete = array();
         $results_incomplete = array();
         $results_complete = $regSummaries->getCampusRegistrations($this->event_id, '', false, $campusList, '', RowManager_RegistrationManager::STATUS_REGISTERED);
         $results_incomplete = $regSummaries->getCampusRegistrations($this->event_id, '', false, $campusList, '', RowManager_RegistrationManager::STATUS_INCOMPLETE);
         //      	 $results = array_merge( $results_male, $results_female );
         reset($results);
         //      	 reset($results_male);
         //      	 reset($results_female);
         // go through total registrations in parallel with other results
         foreach (array_keys($campusArray) as $k) {
             $total = current($results);
             $regCampusID = key($results);
             $campusID = key($campusArray);
             //key($results);
             // retrieve campus name given the campus ID
             $campus = new RowManager_CampusManager($campusID);
             $campusName = $campus->getDesc();
             // process registration total if it matches the current campus ID
             if ($regCampusID == $campusID) {
                 // set total valid non-cancelled registrations for current campus (and event)
                 if (isset($results_cancelled[$campusID])) {
                     $cancelled = $results_cancelled[$campusID];
                     // 							$total = $total - $cancelled;
                 } else {
                     $cancelled = 0;
                 }
                 // set total females registered for current campus (and event)
                 if (isset($results_female[$campusID])) {
                     $females = $results_female[$campusID];
                 } else {
                     $females = 0;
                 }
                 // set total complete registrations for current campus (and event)
                 if (isset($results_complete[$campusID])) {
                     $completes = $results_complete[$campusID];
                 } else {
                     $completes = 0;
                 }
                 // set total incomplete registrations for current campus (and event)
                 if (isset($results_incomplete[$campusID])) {
                     $incompletes = $results_incomplete[$campusID];
                 } else {
                     $incompletes = 0;
                 }
                 //				$females = current($results_female);
                 //				$males = $results_male[$campusName];
                 // set total registered males
                 $males = $total - $females;
                 //current($results_male);//
                 //        		echo $campusName.': '.$total.' : '.$males.' : '.$females.'<br>';
                 //        		echo 'cancelled : '.$cancelled.'<br>';
                 // set registration summary values for current campus
                 $aCampus = array();
                 $aCampus['campus_desc'] = $campusName;
                 $aCampus['regLink'] = '#';
                 //$this->linkValues[ 'CampusLink' ].$campusID;//$this->event_id."_".$campusID;
                 $aCampus['numMales'] = $males;
                 $aCampus['numFemales'] = $females;
                 $aCampus['campusTotal'] = $total;
                 $aCampus['cancellations'] = $cancelled;
                 $aCampus['completes'] = $completes;
                 $aCampus['incompletes'] = $incompletes;
                 // 		        		$summaryTotals['numMales'] += $males;
                 // 		        		$summaryTotals['numFemales'] += $females;
                 // 		        		$summaryTotals['campusTotal'] += $total;
                 // 		        		$summaryTotals['cancellations'] += $cancelled;
                 next($results);
                 // increment array-pointer for registration totals array
             } else {
                 // set registration summary values for current campus
                 $aCampus = array();
                 $aCampus['campus_desc'] = $campusName;
                 $aCampus['regLink'] = '#';
                 //$this->linkValues[ 'CampusLink' ].$campusID;//$this->event_id."_".$campusID;
                 $aCampus['numMales'] = 0;
                 $aCampus['numFemales'] = 0;
                 $aCampus['campusTotal'] = 0;
                 $aCampus['cancellations'] = 0;
                 $aCampus['completes'] = 0;
                 $aCampus['incompletes'] = 0;
             }
             //       		        $editLink = $this->getCallBack( modulecim_reg::PAGE_ADMINEVENTHOME, $this->sortBy, $parameters );
             //       $editLink .= "&". modulecim_reg::REG_ID . "=";
             //       CampusLink
             if ($privManager->isCampusAdmin($this->event_id, $campusID) == true) {
                 $aCampus['regLink'] = $campus_link . $campusID;
                 // $this->linkValues[ 'CampusLink' ].$campusID;
             }
             // <START> USED TO BE INSIDE CAMPUS ADMIN PRIV. CHECK
             // BUT NOW ALL CAMPUS ADMINS CAN SEE SUMMARY DATA... ONLY REGISTRATION LINKS NOT SHOWN FOR INVALID CAMPUSES
             // store campus summary info in array indexed by campus name
             $campusLevelLinks[$campusName] = $aCampus;
             // 	        		if ($is_campus_admin == false) {
             // 		        		$this->template->set('isCampusAdmin', true);
             // 		        		$is_campus_admin = true;
             // 	        		}
             // <END>
             next($campusArray);
             //				next($results_female);
             //				next($results_male);
         }
         $this->summary_data = $campusLevelLinks;
         /*** END CAMPUS REGISTRATION SUMMARY DATA RETRIEVAL ***/
         /**** SET TOTAL  *UNIQUE*  REGISTRATIONS *******/
         $totalRegs = array();
         $totalRegs = $regSummaries->getUniqueRegistrations($this->event_id);
         // 				echo "Total unique regs: ".count($totalRegs);
         $femaleRegs = array();
         $gender = 'female';
         $femaleRegs = $regSummaries->getUniqueRegistrations($this->event_id, $gender);
         // 				echo "<br>Total male regs: ".(count($totalRegs)-count($femaleRegs));
         // 				echo "<br>Total female regs: ".count($femaleRegs);
         $cancelledRegs = array();
         $gender = '';
         $areCancelled = true;
         $cancelledRegs = $regSummaries->getUniqueRegistrations($this->event_id, $gender, $areCancelled);
         // 				echo "<br>Total cancelled regs: ".count($cancelledRegs);
         $completeRegs = array();
         $gender = '';
         $areCancelled = false;
         $status = RowManager_RegistrationManager::STATUS_REGISTERED;
         $completeRegs = $regSummaries->getUniqueRegistrations($this->event_id, $gender, $areCancelled, $status);
         $incompleteRegs = array();
         $gender = '';
         $areCancelled = false;
         $status = RowManager_RegistrationManager::STATUS_INCOMPLETE;
         $incompleteRegs = $regSummaries->getUniqueRegistrations($this->event_id, $gender, $areCancelled, $status);
         $this->summaryTotals['label'] = 'Total (Unique) Registrations:';
         $this->summaryTotals['blank'] = '';
         // 'Registrations' link has no need for a total...
         $this->summaryTotals['numMales'] = count($totalRegs) - count($femaleRegs);
         $this->summaryTotals['numFemales'] = count($femaleRegs);
         $this->summaryTotals['campusTotal'] = count($totalRegs);
         $this->summaryTotals['cancellations'] = count($cancelledRegs);
         $this->summaryTotals['completes'] = count($completeRegs);
         $this->summaryTotals['incompletes'] = count($incompleteRegs);
     }
     // now initialize the labels for this page
     // start by loading the default field labels for this Module
     $languageID = $viewer->getLanguageID();
     $seriesKey = modulecim_reg::MULTILINGUAL_SERIES_KEY;
     $pageKey = page_AdminEventHome::MULTILINGUAL_PAGE_KEY;
     $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey);
 }
Exemplo n.º 17
0
 /**
  * function __construct
  * <pre>
  * Initialize the object.
  * </pre>
  * @return [void]
  */
 function __construct($displayFieldList)
 {
     parent::__construct();
     $this->displayFields = $displayFieldList;
     $this->linkColumns = array();
 }