require '../General/gen_Defines.php';
require '../General/gen_Includes.php';
// 	require('../objects/SiteObject.php');
// 	require('../objects/Page.php');
require '../modules/app_cim_reg/objects_da/EventManager.php';
require '../modules/app_cim_reg/objects_da/PriceRuleManager.php';
require '../modules/app_cim_reg/objects_da/FieldValueManager.php';
require '../modules/app_cim_reg/objects_da/ScholarshipAssignmentManager.php';
require '../modules/app_cim_reg/objects_da/CashTransactionManager.php';
require '../modules/app_cim_reg/objects_da/CreditCardTransactionManager.php';
$toolName = '../Tools/tools_Finances.php';
$toolPath = '';
//Page::findPathExtension( $toolName );
require_once $toolPath . $toolName;
// get privileges for the current viewer
$privManager = new PrivilegeManager($this->viewer->getID());
if ($privManager->isCampusAdmin($this->EVENT_ID, $this->CAMPUS_ID) == true) {
    /********** NOTE: make sure 60 second PHP timeout is not activated: use filters, such as event_id  ************/
    $EVENT_ID = 18;
    // retrieve registration records
    $regs = new RowManager_RegistrationManager();
    $regs->setEventID($EVENT_ID);
    $regsList = $regs->getListIterator();
    $regsArray = $regsList->getDataList();
    $priceGetter = new FinancialTools();
    reset($regsArray);
    foreach (array_keys($regsArray) as $k) {
        $record = current($regsArray);
        $reg_id = $record['registration_id'];
        $owed = $priceGetter->simpleCalcBalanceOwing($reg_id);
        // store calculated balance owing in registration record
 /**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  */
 function getHTML()
 {
     $regSummaries = new RegSummaryTools();
     // 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;
     /*
      * Update any label tags ...
      */
     // example:
     // $name = $user->getName();
     $event = new RowManager_EventManager($this->event_id);
     $this->labels->setLabelTag('[Instr]', '[eventName]', $event->getEventName());
     // NOTE:  this parent method prepares the $this->template with the
     // common Display data.
     $this->prepareTemplate($path);
     // pass in the labels for the outer template
     //		$labels = new MultiLingual_Labels( GPC_SITE_LABEL, GPC_SERIES_LABEL, TEMPLATE_PAGE, $langID );
     //		$page->set('labels', $labels );
     // get privileges for the current viewer
     $privManager = new PrivilegeManager($this->viewer->getID());
     if ($privManager->isEventAdmin($this->event_id) == true) {
         $this->template->set('isEventAdmin', true);
         // display messages based on balance owing recalculation status
         switch ($this->recalcStatus) {
             // display balance owing recalculation COMPLETED message
             case FinancialTools::RECALC_COMPLETE:
                 $this->template->set('isRecalculated', true);
                 $completedMsg = $this->labels->getLabel('[RecalcCompleteMsg]');
                 $this->template->set('recalcMessage', $completedMsg);
                 break;
                 // display balance owing recalculation NEEDED message
             // display balance owing recalculation NEEDED message
             case FinancialTools::RECALC_NEEDED:
                 $this->template->set('needsRecalculation', true);
                 $completedMsg = $this->labels->getLabel('[RecalcNeededMsg]');
                 $this->template->set('recalcMessage', $completedMsg);
                 break;
             default:
                 break;
         }
     }
     $this->template->set('backLink', $this->linkValues['BackLink']);
     //$superAdminPrefix = 'superAdmin_';
     //$this->template->set('superAdminPrefix', $superAdminPrefix );
     $superAdminLevelLinks = array();
     $campusLevelLinks = array();
     $eventLevelLinks = array();
     $financeLevelLinks = array();
     if ($privManager->isSuperAdmin() == true) {
         $this->template->set('isSuperAdmin', true);
         //Super Admin Level links (order is important == viewing order)
         $superAdminLevelLinks['AddSuperAdmins'] = $this->linkValues['AddSuperAdmins'];
         $superAdminLevelLinks['EditPrivilegeTypes'] = $this->linkValues['EditPrivilegeTypes'];
         $superAdminLevelLinks['EditFieldTypes'] = $this->linkValues['EditFieldTypes'];
         $superAdminLevelLinks['EditPriceRuleTypes'] = $this->linkValues['EditPriceRuleTypes'];
         $superAdminLevelLinks['EditCreditCardTypes'] = $this->linkValues['EditCreditCardTypes'];
         $superAdminLevelLinks['EditStatusTypes'] = $this->linkValues['EditStatusTypes'];
         $this->template->set('superAdminLevelLinks', $superAdminLevelLinks);
     }
     //Campus Level links
     /** TODO: move the below code into an earlier page and pass on priv. info OR put in helper function ***/
     /** ALSO: make use of this or similar code for restricting access to campus-level registrations **/
     /** CHECK PRIVILEGE LEVEL IN ORDER TO DETERMINE WHICH CAMPUS REGISTRATION LINKS TO SHOW **/
     //         $viewer_id = $this->viewer->getViewerID();
     //         $accessAll = false;
     //         $accessCampuses = array();
     //
     //         $superAdmin = new RowManager_SuperAdminAssignmentManager();
     //         $superAdmin->setViewerID($viewer_id);
     //         $superAdminList = new ListIterator($superAdmin);
     //   		  $superAdminArray = $superAdminList->getDropListArray();
     // //     		echo "super: <pre>".print_r($superAdminArray, true)."</pre>";
     //
     // 			// all campuses can be accessed if user/viewer is super-admin
     //         if (count($superAdminArray) > 0)
     //         {
     // 	        $accessAll = true;
     //         }
     //         else	// check if viewer is finance-level, event-level, or campus-level admin
     //         {
     // 	        // TODO: retrieve these constants from the database using PrivilegeTypeManager
     // 	         $EVENT_LEVEL = 3;
     // 	         $FINANCE_LEVEL = 2;
     // 	         $CAMPUS_LEVEL = 4;
     //
     // 	         $eventAdmin = new RowManager_EventAdminAssignmentManager();
     //         		$eventAdmin->setEventID($this->event_id);
     //         		$eventAdmin->setViewerID($viewer_id);
     //         		$eventAdmin->setPrivilege($EVENT_LEVEL." or ".$FINANCE_LEVEL);
     //         		$eventAdminList = new ListIterator($eventAdmin);
     //         		$eventAdminArray = $eventAdminList->getDropListArray();
     // //        		echo "eventAdmin: <pre>".print_r($eventAdminArray, true)."</pre>";
     // 				// grant access to all campuses if viewer is event-level or finance-level admin
     //         		if (count($eventAdminArray) < 0)
     //         		{
     // 	        		$accessAll = true;
     //   				}
     //   				else 	// TODO: retrieve campus list if viewer has campus-level admin privileges
     //   				{
     // 	  				$eventAdmin2 = new RowManager_EventAdminAssignmentManager();
     // 	        		$eventAdmin2->setEventID($this->event_id);
     // 	        		$eventAdmin2->setViewerID($viewer_id);
     // 	  				$eventAdmin2->setPrivilege($CAMPUS_LEVEL);
     // 	        		$eventAdminList2 = new ListIterator($eventAdmin2);
     // 	        		$eventAdminArray2 = $eventAdminList2->getDropListArray();
     // //	        		echo "eventAdmin2: <pre>".print_r($eventAdminArray2, true)."</pre>";
     //         		}
     //
     //       	}
     /** END PRIVILEGE CHECKING **/
     //       	$is_campus_admin = false;
     if ($privManager->isBasicAdmin($this->event_id) == true) {
         $this->template->set('isCampusAdmin', true);
         /** RETRIEVE CAMPUS REGISTRATION SUMMARY DATA ***/
         //TODO?: put some/all of this into a helper method
         // initialized template arrays
         $campusLevelLinks = array();
         $summaryTotals = array();
         $summaryTotals['numMales'] = 0;
         $summaryTotals['numFemales'] = 0;
         $summaryTotals['campusTotal'] = 0;
         $summaryTotals['cancellations'] = 0;
         // get all campuses
         $campuses = new RowManager_CampusManager();
         $campuses->setSortOrder('campus_desc');
         $campusList = $campuses->getListIterator();
         $campusArray = $campusList->getDataList();
         reset($campusArray);
         // 	     		echo 'campus array = <pre>'.print_r($campusArray,true).'</pre>';
         // retrieve cancellations (for current event)
         $results_cancelled = array();
         $results_cancelled = $regSummaries->getCampusRegistrations($this->event_id, '', true);
         // retrieve total registrations and total females registered (for current event)
         $results = array();
         $results_female = array();
         $results = $regSummaries->getCampusRegistrations($this->event_id, '');
         $results_female = $regSummaries->getCampusRegistrations($this->event_id, 'female');
         // 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, '', '', RowManager_RegistrationManager::STATUS_REGISTERED);
         $results_incomplete = $regSummaries->getCampusRegistrations($this->event_id, '', false, '', '', 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'] = $this->linkValues['CampusLink'] . $campusID;
                 //$this->event_id."_".$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);
         }
         /*** END CAMPUS REGISTRATION SUMMARY DATA RETRIEVAL ***/
         $this->template->set('linkText', 'Registrations');
         $this->template->set('campusLevelLinks', $campusLevelLinks);
         /**** 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);
         $summaryTotals['numMales'] = count($totalRegs) - count($femaleRegs);
         $summaryTotals['numFemales'] = count($femaleRegs);
         $summaryTotals['campusTotal'] = count($totalRegs);
         $summaryTotals['cancellations'] = count($cancelledRegs);
         $summaryTotals['completes'] = count($completeRegs);
         $summaryTotals['incompletes'] = count($incompleteRegs);
         $this->template->set('summaryTotals', $summaryTotals);
     }
     if ($privManager->isEventAdmin($this->event_id) == true) {
         //Event Level links
         $eventLevelLinks['AddEventAdmins'] = $this->linkValues['AddEventAdmins'];
         $eventLevelLinks['AddCampusAdmins'] = $this->linkValues['AddCampusAdmins'];
         $eventLevelLinks['RecalculateBalances'] = $this->linkValues['RecalculateBalances'];
         $eventLevelLinks['EditEventDetails'] = $this->linkValues['EditEventDetails'];
         $eventLevelLinks['EditEventFormFields'] = $this->linkValues['EditEventFormFields'];
         $eventLevelLinks['EditEventPriceRules'] = $this->linkValues['EditEventPriceRules'];
         $eventLevelLinks['EventDataDump'] = $this->linkValues['EventDataDump'];
         $eventLevelLinks['EventScholarshipList'] = $this->linkValues['EventScholarshipList'];
         $this->template->set('eventLevelLinks', $eventLevelLinks);
         //$editEventDetailsLink = $this->linkValues[ 'editEventDetailsLink' ];
         //$this->template->set('editEventDetailsLink', $editEventDetailsLink );
     }
     if ($privManager->isFinanceAdmin($this->event_id) == true) {
         $this->template->set('isFinanceAdmin', true);
         //Finance Level links
     }
     // uncomment this line if you are creating a template for this page
     $templateName = 'page_AdminEventHome.php';
     // otherwise use the generic site template
     //$templateName = '';
     return $this->template->fetch($templateName);
 }
Пример #3
0
 /**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  *
  * ON JAN 2, 2008 Russ made two changes to this page to restore the original functionality... they are documented below.
  * ON JAN 8, 2008 Hobbe added conditional statements to allow registration record searches IF viewer has Reg. Sys. Super Admin privs.
  */
 function getHTML()
 {
     // Uncomment the following line if you want to create a template
     // tailored for this page:
     $privManager = new PrivilegeManager($this->viewer->getID());
     if ($privManager->isSuperAdmin() == true) {
         $path = SITE_PATH_TEMPLATES;
     } else {
         // Changed by RM from using the assignment below on Jan 2, 2008.
         $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);
     // 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->registration_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_RegistrationManager::XML_NODE_NAME;
     $this->template->set('rowManagerXMLNodeName', $xmlNodeName);
     // store the primary key field name for the data being displayed
     $this->template->set('primaryKeyFieldName', 'registration_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.
     if ($this->person_id != '') {
         $dataAccessManager = new RowManager_RegistrationManager();
         $dataAccessManager->setPersonID($this->person_id);
         $dataAccessManager->setSortOrder($this->sortBy);
         //        $this->dataList = new PriceRuleList( $this->sortBy );
         $this->dataList = $dataAccessManager->getListIterator();
         $this->template->setXML('dataList', $this->dataList->getXML());
     }
     //         else
     //         {
     // 	        $this->dataList = array();
     // // 	        $this->template->setXML( 'dataList', $this->dataList->getXML() );
     //         }
     /*
      * Add any additional data required by the template here
      */
     $person = new RowManager_PersonManager();
     $person->setLabelTemplateLastNameFirstName();
     //         $field->setPersonID( $this->person_id);
     $person->setSortOrder('person_lname, person_fname');
     $personList = new ListIterator($person);
     $personArray = $personList->getDropListArray();
     $this->template->set('list_person_id', $personArray);
     $notice = "<br><b>NOTE:</b> Duplicate names may appear if a person has multiple records.";
     $this->template->set('note_person_id', $notice);
     $event = new RowManager_EventManager();
     //         $field->setPersonID( $this->person_id);
     $eventList = new ListIterator($event);
     $eventArray = $eventList->getDropListArray();
     $this->template->set('list_event_id', $eventArray);
     $status = new RowManager_StatusManager();
     $statusList = new ListIterator($status);
     $statusArray = $statusList->getDropListArray();
     $this->template->set('list_registration_status', $statusArray);
     //
     //         $nameFields = 'person_lname,person_fname';
     //         $template = '[person_lname], [person_fname]';
     //         $this->dataManager->setLabelTemplate( $nameFields, $template );
     if ($privManager->isSuperAdmin() == true) {
         $templateName = 'siteSearchFormDataList.php';
         //'page_HrdbHome.php';
     } else {
         // Changed by RM on Jan 2, 2008 - We can't have just anybody being able to access this data.
         $templateName = 'page_HrdbHome.php';
     }
     // if you are creating a custom template for this page then
     // replace $templateName with the following:
     //$templateName = 'page_EditPriceRules.php';
     return $this->template->fetch($templateName);
 }
Пример #4
0
 /**
  * function loadPersonRecordCleanUp
  * <pre>
  * Initializes the PersonRecordCleanUp Page.
  * </pre>
  * @params	<person data filter parameters: first name, last name, e-mail, max exec time>
  * @return [void]
  */
 function loadPersonRecordCleanUp($person_fname, $person_lname, $person_email, $max_exec_time)
 {
     // get privileges for the current viewer
     $privManager = new PrivilegeManager($this->viewer->getID());
     if ($privManager->isSuperAdmin() == true) {
         // set the pageCallBack to be without any additional parameters
         // (an AdminBox needs this so Language Switching on a page doesn't
         // pass a previous operations)
         $parameters = array('PRIV_ID' => $this->PRIV_ID, 'VIEWER_ID' => $this->VIEWER_ID);
         //[RAD_CALLBACK_PARAMS]
         $pageCallBack = $this->getCallBack(modulecim_reg::PAGE_PERSONRECORDCLEANUP, $this->sortBy, $parameters);
         $this->setPageCallBack($pageCallBack);
         $this->pageDisplay = new page_PersonRecordCleanUp($this->moduleRootPath, $this->viewer, $this->sortBy, $person_fname, $person_lname, $person_email, $max_exec_time);
         $links = array();
         $parameters = array();
         //, 'FIELDTYPE_ID'=>$this->FIELDTYPE_ID, 'PRICERULETYPE_ID'=>$this->PRICERULETYPE_ID, 'CCTYPE_ID'=>$this->CCTYPE_ID, 'PRIV_ID'=>$this->PRIV_ID, 'VIEWER_ID'=>$this->VIEWER_ID, 'SUPERADMIN_ID'=>$this->SUPERADMIN_ID, 'EVENTADMIN_ID'=>$this->EVENTADMIN_ID, 'FIELD_ID'=>$this->FIELD_ID, 'DATATYPE_ID'=>$this->DATATYPE_ID, 'PRICERULE_ID'=>$this->PRICERULE_ID, 'CAMPUSACCESS_ID'=>$this->CAMPUSACCESS_ID, 'CASHTRANS_ID'=>$this->CASHTRANS_ID, 'CCTRANS_ID'=>$this->CCTRANS_ID, 'REG_ID'=>$this->REG_ID, 'FIELDVALUE_ID'=>$this->FIELDVALUE_ID, 'SCHOLARSHIP_ID'=>$this->SCHOLARSHIP_ID, 'STATUS_ID'=>$this->STATUS_ID);	//, 'CAMPUS_ID'=>$this->CAMPUS_ID);//[RAD_CALLBACK_PARAMS]
         $continueLink = $this->getCallBack(modulecim_reg::PAGE_PERSONRECORDCLEANUP_FORM, "", $parameters);
         $links["cont"] = $continueLink;
         $this->pageDisplay->setLinks($links);
     } else {
         $this->pageDisplay = new page_NotAuthorized($this->moduleRootPath, $this->viewer);
     }
 }
 /**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  */
 function getHTML()
 {
     $regSummaries = new RegSummaryTools();
     // 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;
     /*
      * Update any label tags ...
      */
     // example:
     // $name = $user->getName();
     $event = new RowManager_EventManager($this->event_id);
     $this->labels->setLabelTag('[Instr]', '[eventName]', $event->getEventName());
     // NOTE:  this parent method prepares the $this->template with the
     // common Display data.
     $this->prepareTemplate($path);
     // pass in the labels for the outer template
     //		$labels = new MultiLingual_Labels( GPC_SITE_LABEL, GPC_SERIES_LABEL, TEMPLATE_PAGE, $langID );
     //		$page->set('labels', $labels );
     // get privileges for the current viewer
     $privManager = new PrivilegeManager($this->viewer->getID());
     if ($privManager->isEventAdmin($this->event_id) == true) {
         $this->template->set('isEventAdmin', true);
         // display messages based on balance owing recalculation status
         switch ($this->recalcStatus) {
             // display balance owing recalculation COMPLETED message
             case FinancialTools::RECALC_COMPLETE:
                 $this->template->set('isRecalculated', true);
                 $completedMsg = $this->labels->getLabel('[RecalcCompleteMsg]');
                 $this->template->set('recalcMessage', $completedMsg);
                 break;
                 // display balance owing recalculation NEEDED message
             // display balance owing recalculation NEEDED message
             case FinancialTools::RECALC_NEEDED:
                 $this->template->set('needsRecalculation', true);
                 $completedMsg = $this->labels->getLabel('[RecalcNeededMsg]');
                 $this->template->set('recalcMessage', $completedMsg);
                 break;
             default:
                 break;
         }
     }
     $this->template->set('backLink', $this->linkValues['BackLink']);
     //$superAdminPrefix = 'superAdmin_';
     //$this->template->set('superAdminPrefix', $superAdminPrefix );
     $superAdminLevelLinks = array();
     $campusLevelLinks = array();
     $eventLevelLinks = array();
     $financeLevelLinks = array();
     if ($privManager->isSuperAdmin() == true) {
         $this->template->set('isSuperAdmin', true);
         //Super Admin Level links (order is important == viewing order)
         $superAdminLevelLinks['AddSuperAdmins'] = $this->linkValues['AddSuperAdmins'];
         $superAdminLevelLinks['EditPrivilegeTypes'] = $this->linkValues['EditPrivilegeTypes'];
         $superAdminLevelLinks['EditFieldTypes'] = $this->linkValues['EditFieldTypes'];
         $superAdminLevelLinks['EditPriceRuleTypes'] = $this->linkValues['EditPriceRuleTypes'];
         $superAdminLevelLinks['EditCreditCardTypes'] = $this->linkValues['EditCreditCardTypes'];
         $superAdminLevelLinks['EditStatusTypes'] = $this->linkValues['EditStatusTypes'];
         $this->template->set('superAdminLevelLinks', $superAdminLevelLinks);
     }
     //Campus Level links
     /** TODO: move the below code into an earlier page and pass on priv. info OR put in helper function ***/
     /** ALSO: make use of this or similar code for restricting access to campus-level registrations **/
     /** CHECK PRIVILEGE LEVEL IN ORDER TO DETERMINE WHICH CAMPUS REGISTRATION LINKS TO SHOW **/
     //         $viewer_id = $this->viewer->getViewerID();
     //         $accessAll = false;
     //         $accessCampuses = array();
     //
     //         $superAdmin = new RowManager_SuperAdminAssignmentManager();
     //         $superAdmin->setViewerID($viewer_id);
     //         $superAdminList = new ListIterator($superAdmin);
     //   		  $superAdminArray = $superAdminList->getDropListArray();
     // //     		echo "super: <pre>".print_r($superAdminArray, true)."</pre>";
     //
     // 			// all campuses can be accessed if user/viewer is super-admin
     //         if (count($superAdminArray) > 0)
     //         {
     // 	        $accessAll = true;
     //         }
     //         else	// check if viewer is finance-level, event-level, or campus-level admin
     //         {
     // 	        // TODO: retrieve these constants from the database using PrivilegeTypeManager
     // 	         $EVENT_LEVEL = 3;
     // 	         $FINANCE_LEVEL = 2;
     // 	         $CAMPUS_LEVEL = 4;
     //
     // 	         $eventAdmin = new RowManager_EventAdminAssignmentManager();
     //         		$eventAdmin->setEventID($this->event_id);
     //         		$eventAdmin->setViewerID($viewer_id);
     //         		$eventAdmin->setPrivilege($EVENT_LEVEL." or ".$FINANCE_LEVEL);
     //         		$eventAdminList = new ListIterator($eventAdmin);
     //         		$eventAdminArray = $eventAdminList->getDropListArray();
     // //        		echo "eventAdmin: <pre>".print_r($eventAdminArray, true)."</pre>";
     // 				// grant access to all campuses if viewer is event-level or finance-level admin
     //         		if (count($eventAdminArray) < 0)
     //         		{
     // 	        		$accessAll = true;
     //   				}
     //   				else 	// TODO: retrieve campus list if viewer has campus-level admin privileges
     //   				{
     // 	  				$eventAdmin2 = new RowManager_EventAdminAssignmentManager();
     // 	        		$eventAdmin2->setEventID($this->event_id);
     // 	        		$eventAdmin2->setViewerID($viewer_id);
     // 	  				$eventAdmin2->setPrivilege($CAMPUS_LEVEL);
     // 	        		$eventAdminList2 = new ListIterator($eventAdmin2);
     // 	        		$eventAdminArray2 = $eventAdminList2->getDropListArray();
     // //	        		echo "eventAdmin2: <pre>".print_r($eventAdminArray2, true)."</pre>";
     //         		}
     //
     //       	}
     /** END PRIVILEGE CHECKING **/
     //       	$is_campus_admin = false;
     if ($privManager->isBasicAdmin($this->event_id) == true) {
         $this->template->set('isCampusAdmin', true);
         /** HSMIT, Dec 6, 2007: MOVED REG SUMMARY DATA RETRIEVAL TO CONSTRUCTOR **/
         $campusLevelLinks = $this->summary_data;
         /*** END CAMPUS REGISTRATION SUMMARY DATA RETRIEVAL ***/
         $this->template->set('linkText', 'Registrations');
         $this->template->set('campusLevelLinks', $campusLevelLinks);
         /** HSMIT: Dec 13, 2007: MOVED REG SUMMARY TOTALS TO CONSTRUCTOR **/
         $this->template->set('summaryTotals', $this->summaryTotals);
     }
     if ($privManager->isEventAdmin($this->event_id) == true) {
         //Event Level links
         $eventLevelLinks['DownloadSummary'] = $this->linkValues['DownloadSummary'];
         $eventLevelLinks['EmailRegistrants'] = $this->linkValues['EmailRegistrants'];
         $eventLevelLinks['AddEventAdmins'] = $this->linkValues['AddEventAdmins'];
         $eventLevelLinks['AddCampusAdmins'] = $this->linkValues['AddCampusAdmins'];
         $eventLevelLinks['RecalculateBalances'] = $this->linkValues['RecalculateBalances'];
         $eventLevelLinks['EditEventDetails'] = $this->linkValues['EditEventDetails'];
         $eventLevelLinks['EditEventFormFields'] = $this->linkValues['EditEventFormFields'];
         $eventLevelLinks['EditEventPriceRules'] = $this->linkValues['EditEventPriceRules'];
         $eventLevelLinks['EventDataDump'] = $this->linkValues['EventDataDump'];
         $eventLevelLinks['EventScholarshipList'] = $this->linkValues['EventScholarshipList'];
         $this->template->set('eventLevelLinks', $eventLevelLinks);
         //$editEventDetailsLink = $this->linkValues[ 'editEventDetailsLink' ];
         //$this->template->set('editEventDetailsLink', $editEventDetailsLink );
     }
     if ($privManager->isFinanceAdmin($this->event_id) == true) {
         $this->template->set('isFinanceAdmin', true);
         //Finance Level links
     }
     // uncomment this line if you are creating a template for this page
     $templateName = 'page_AdminEventHome.php';
     // otherwise use the generic site template
     //$templateName = '';
     return $this->template->fetch($templateName);
 }