/** * 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); // 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->assignment_id); $this->template->set('notice', $this->notice); $this->template->set('errorMessage', $this->error_message); // 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 primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'assignment_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_EditCampusAssignmentManager(); $dataAccessManager->setPersonID($this->person_id); if ($this->campus_id != '') { $dataAccessManager->setCampusID($this->campus_id); } $dataAccessManager->setSortOrder($this->sortBy); $this->dataList = $dataAccessManager->getListIterator(); // Store the XML Node name for the Data Access Field List $xmlNodeName = $this->dataList->getRowManagerXMLNodeName(); //RowManager_EditCampusAssignmentManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); $this->template->setXML('dataList', $this->dataList->getXML()); // enable drop-down list for adding new person assignments $personManager = new RowManager_PersonManager(); $campusManager = new RowManager_CampusManager(); /* $combinedManager = new MultiTableManager(); $combinedManager->addRowManager($personManager); $combinedManager->addRowManager($dataAccessManager, new JoinPair($personManager->getJoinOnPersonID(),$dataAccessManager->getJoinOnPersonID())); // $combinedManager->addRowManager($campusManager, new JoinPair($campusManager->getJoinOnCampusID(),$dataAccessManager->getJoinOnCampusID())); if ($this->person_id!='') { $combinedManager->constructSearchCondition( 'person_id', '=', $this->person_id, true ); } if ($this->campus_id!='') { $combinedManager->constructSearchCondition( 'campus_id', '=', $this->campus_id, true ); } $dataList = $combinedManager->getListIterator(); $dataArray = $dataList->getDropListArray(); /**/ // $personManager = new RowManager_PersonManager($this->person_id); // $personList = $personManager->getListIterator(); // $personArray = $personList ->getDropListArray(); // $this->template->set( 'list_person_id', $personArray ); // $personList = $combinedManager->getListIterator(); $personManager->setPersonID($this->person_id); $personManager->setLabelTemplateLastNameFirstName(); $personList = $personManager->getListIterator(); $personArray = $personList->getDropListArray(); $this->template->set('list_person_id', $personArray); // enable drop-down list for adding new campus assignments if ($this->campus_id != '') { $campusManager->setCampusID($this->campus_id); } $campusList = $campusManager->getListIterator(); // $campusList = $combinedManager->getListIterator(); $campusArray = $campusList->getDropListArray(); $this->template->set('list_campus_id', $campusArray); // enable drop-down list for adding new campus assignments $statusManager = new RowManager_CampusAssignmentStatusManager(); $statusList = $statusManager->getListIterator(); // $statusList = $combinedManager->getListIterator(); $statusArray = $statusList->getDropListArray(); $this->template->set('list_assignmentstatus_id', $statusArray); // $dataAccessManager->setPersonID($this->person_id); // $dataAccessManager->setCampusID($this->campus_id); // $this->dataList = new EditCampusAssignmentList( $this->sortBy ); // $this->dataList = $combinedManager->getListIterator(); /* * Add any additional data required by the template here */ // $this->displayValues = $templateName = 'siteAdminBox.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditCampusAssignment.php'; return $this->template->fetch($templateName); }
/** * function getHTML * <pre> * This method returns the HTML data generated by this object. * </pre> * @return [STRING] HTML Display data. */ function getHTML() { // Make a new Template object $path = $this->pathModuleRoot . 'templates/'; // Replace $path with the following line if you want to create a // template tailored for this page: //$path = $this->pathModuleRoot.'templates/'; // store the link values // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['add'] = $this->labels->getLabel('[Add]'); $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[GoBack]'); $this->linkLabels['CampusEventDataDump'] = 'Download Campus-specific Event Registration Summary'; $this->linkLabels['CampusEventScholarshipList'] = 'Download Campus-specific Scholarship List'; $this->linkLabels['EmailCampusRegistrants'] = $this->labels->getLabel('[EmailCampusRegistrants]'); // $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); // store the page labels // NOTE: use this location to update any label tags ... // example: // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); $this->prepareTemplate($path); // has viewer just returned from offline registration process? if ($this->is_in_reg_process == 'TRUE') { $this->template->set('regCompleted', $this->is_in_reg_process); $reg_result = $this->setRegistrationStatus(); // uses reg_id from offline reg process to get status $result_array = explode('|', $reg_result); $reg_status = $result_array[0]; $reg_message = $result_array[1]; $this->template->set('regStatus', $reg_status); // only send e-mail if all pertinent registration info has been stored (including cash/CC event deposit, if applicable) if ($reg_status == RowManager_StatusManager::REGISTERED) { if (!defined('IGNORE_EMAILS')) { $reg_message = $this->sendConfirmationEmail(); // since reg_message = '' if REGISTERED, use for e-mail status message } } $this->template->set('regMessage', $reg_message); } $campuses = new RowManager_CampusManager(); $campuses->setCampusID($this->campus_id); $campusList = $campuses->getListIterator(); $campusArray = $campusList->getDataList(); // only 1 campus per campus_id $the_campus = current($campusArray); $this->campus_name = $the_campus['campus_desc']; $this->template->set('campusName', $this->campus_name); // store the Row Manager's XML Node Name // $this->template->set( 'rowManagerXMLNodeName', RowManager_RegistrationManager::XML_NODE_NAME ); $this->template->set('rowManagerXMLNodeName', MultiTableManager::XML_NODE_NAME); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'registration_id'); $boolArray = array(); $boolArray['0'] = 'no'; $boolArray['1'] = 'yes'; $this->template->set('list_cctransaction_processed', $boolArray); $this->template->set('list_cashtransaction_recd', $boolArray); $this->template->set('owingArray', $this->owingArray); // load offline registrations registrant drop-down list $this->template->set('offlineRegistrationBox', $this->generateRegistrantsDroplist()); // TODO: somehow merge the primary join with the balance owing join.... for efficiency /* * Set up any additional data transfer to the Template here... */ // $this->template->set( 'dataList', $this->dataList); $templateName = 'page_EditCampusRegistrations.tpl.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditCampusRegistrations.php'; return $this->template->fetch($templateName); }
/** * function isCampusAdmin * <pre> * return whether viewer is a campus admin for given event and campus * </pre> * @return [boolean] */ function isCampusAdmin($eventID, $campusID) { if (isset($this->isCampusAdmin[PrivilegeManager::ALL_EVENTS]) && $this->isCampusAdmin[PrivilegeManager::ALL_EVENTS] == PrivilegeManager::ALL_CAMPUSES) { return true; } if (isset($eventID) && $eventID != '') { if (isset($this->isCampusAdmin[$eventID]) && $this->isCampusAdmin[$eventID] == PrivilegeManager::ALL_CAMPUSES) { return true; } if (isset($campusID) && $campusID != '') { if (isset($this->isCampusAdmin[$eventID])) { $campuses = $this->isCampusAdmin[$eventID]; if ($campuses != '') { $campusArray = explode('|', $campuses); if (in_array($campusID, $campusArray)) { return true; } } } } // if no value was found, determine if the viewer is staff on some campus // $viewers = new RowManager_ViewerManager(); // $viewers->set($this->viewer_id); $access = new RowManager_AccessManager(); $access->setViewerID($this->viewer_id); $person = new RowManager_PersonManager(); $staff = new RowManager_StaffManager(); $staff->setIsActive('1'); $assign = new RowManager_AssignmentsManager(); $assign->setAssignmentStatus(CA_STAFF); $campus = new RowManager_CampusManager(); $campus->setCampusID($campusID); $multiTables = new MultiTableManager(); $multiTables->addRowManager($access); $multiTables->addRowManager($person, new JoinPair($access->getJoinOnPersonID(), $person->getJoinOnPersonID())); $multiTables->addRowManager($staff, new JoinPair($person->getJoinOnPersonID(), $staff->getJoinOnPersonID())); $multiTables->addRowManager($assign, new JoinPair($assign->getJoinOnPersonID(), $person->getJoinOnPersonID())); $multiTables->addRowManager($campus, new JoinPair($assign->getJoinOnCampusID(), $campus->getJoinOnCampusID())); $campusList = $multiTables->getListIterator(); $campusArray = $campusList->getDataList(); // echo 'campus array for user: <pre>'.print_r($campusArray, true).'</pre><br>'; // some campus was found, so viewer is admin for this campus (for all events) if (isset($campusArray) && count($campusArray) > 0) { // store the viewer in the database as a campus id assigned to the current campus /*** TODO: low priority because it is an optimization ***/ return true; } } return false; }