/** * 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 $sortBy [STRING] Field data to sort listManager by. * @param $managerInit [INTEGER] Initialization value for the listManager. * @return [void] */ function __construct($pathModuleRoot, $viewer, $sortBy) { parent::__construct(page_HrdbActivities::DISPLAY_FIELDS); $this->pathModuleRoot = $pathModuleRoot; $this->viewer = $viewer; // $this->managerInit = $managerInit; $dataAccessObject = new RowManager_ActivityTypeManager(); $dataAccessObject->setSortOrder($sortBy); // $this->listManager = new ActivityTypeList( $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_hrdb::MULTILINGUAL_SERIES_KEY; $pageKey = modulecim_hrdb::MULTILINGUAL_PAGE_FIELDS; $this->labels = new MultilingualManager($languageID, $seriesKey, $pageKey); // then load the page specific labels for this page $pageKey = page_HrdbActivities::MULTILINGUAL_PAGE_KEY; $this->labels->loadPageLabels($pageKey); $this->labels->setSeriesKey(SITE_LABEL_SERIES_SITE); $this->labels->loadPageLabels(SITE_LABEL_PAGE_FORM_LINKS); }
* * year_id [INTEGER] id referencing year status * grad_date [DATE] expected graduation date */ $PersonYear = new RowManager_PersonYearManager(); $PersonYear->dropTable(); $PersonYear->createTable(); /* * ActivityType Table * * a type of schedule activity (i.e. vacation, etc) * * activitytype_id [INTEGER] unique id of the staff activity type * activitytype_desc [STRING] Description of the activity type */ $ActivityType = new RowManager_ActivityTypeManager(); $ActivityType->dropTable(); $ActivityType->createTable(); /* * StaffActivity Table * * Records details about some staff member's scheduled activity. * * staffactivity_id [INTEGER] unique id of the staff activity record * person_id [INTEGER] the id of the staff person associated with the activity * staffactivity_startdate [DATE] The start date of the activity * staffactivity_enddate [DATE] The end date of the activity. * staffactivity_contactPhone [STRING] The phone # where the staff member can be reached during the activity. * activitytype_id [INTEGER] The activity's type (i.e. "vacation") */ $StaffActivity = new RowManager_StaffActivityManager();
/** * 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 page labels in XML format... // NOTE: use this location to update any label tags ... // $name = $user->getName(); // $this->labels->setLabelTag( '[Title]', '[userName]', $name); // NOTE: this parent method prepares the $this->template with the // common Form data. $this->prepareTemplate($path); /* * Form related Template variables: */ // store the button label $this->template->set('buttonText', $this->labels->getLabel('[Update]')); // Insert the date start/end values for the following date fields: // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); $this->template->set('startYear_staffscheduletype_startdate', 2008); $this->template->set('endYear_staffscheduletype_startdate', 2018); $this->template->set('startYear_staffscheduletype_enddate', 2008); $this->template->set('endYear_staffscheduletype_enddate', 2018); /**** // Retrieve names and e-mail addresses of registrants (all/per-campus) $data_iterator = $this->dataManager->getListIterator(); $data_array = $data_iterator->getDataList(); $email_contacts = array(); reset($data_array); foreach (array_keys($data_array) as $k) { $record = current($data_array); // $person_id = $record['person_id']; $person_name = $record['person_lname'].', '.$record['person_fname']; $person_email = $record['person_email']; $reg_status = $record['registration_status']; $gender = $record['gender_id']; $index = $person_email; // default index is id of person if ($this->isSelectedContact($reg_status, $gender)) // determine if e-mail contact is SELECTED { $index = '*'.$index; // add modifier to indicated SELECTED status } $email_contacts[$index] = $person_name; //.'<BR>('.$person_email.')'; <BR> doesnt work in listbox next($data_array); } // echo ' contacts = <pre>'.print_r($email_contacts,true).'</pre>'; $this->template->set( 'inclComboInstructions', true ); $this->template->set( 'comboBoxName','email_contacts[]'); $this->template->set( 'comboBoxSize',FormProcessor_EmailComposer::COMBO_BOX_SIZE); $this->template->set( 'comboDataArray',$email_contacts); ******/ /* * Add any additional data required by the template here */ $activityTypesManager = new RowManager_ActivityTypeManager(); $activityTypesList = $activityTypesManager->getListIterator(); $activityTypesArray = $activityTypesList->getDropListArray(); $this->template->set('list_staffscheduletype_activity_types', $activityTypesArray); // uncomment this line if you are creating a template for this page //$templateName = 'page_EditStaffFormContext.php'; // otherwise use the generic admin box template $templateName = 'siteFormSingle.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() { // 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->activitytype_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_ActivityTypeManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'activitytype_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_ActivityTypeManager(); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new ActivityTypeList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); $typeInfoArray = $this->dataList->getDataList(); $colorArray = array(); foreach (array_keys($typeInfoArray) as $activitytype_id) { $record = current($typeInfoArray); $colorCode = $record['activitytype_color']; $colorArray[$colorCode] = '<span style="color:' . $colorCode . ';">' . $colorCode . '</span>'; next($typeInfoArray); } $this->template->set('list_activitytype_color', $colorArray); /* * Add any additional data required by the template here */ $templateName = 'siteAdminBox.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_EditActivityTypes.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 = SITE_PATH_TEMPLATES; $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( '[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); // 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); // store the Row Manager's XML Node Name // $this->template->set( 'rowManagerXMLNodeName', RowManager_AssignmentsManager::XML_NODE_NAME ); $this->template->set('rowManagerXMLNodeName', $this->listManager->getRowManagerXMLNodeName()); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'staffactivity_id'); // Set calendar variables $this->template->set('year_id', $this->year_id); $this->template->set('month_id', $this->month_id); $this->template->set('first_weekday', $this->first_weekday); $this->template->set('monthEventDataList', $this->monthEvents); // echo '<pre>'.print_r($this->monthEvents,true).'</pre>'; $activityTypeColors = new RowManager_ActivityTypeManager(); $typeList = $activityTypeColors->getListIterator(); $typeArray = $typeList->getDataList(); $eventTypeColorArray = array(); reset($typeArray); foreach (array_keys($typeArray) as $key) { $record = current($typeArray); $eventTypeColorArray[$record['activitytype_abbr']] = $record['activitytype_color']; next($typeArray); } $this->template->set('colorCodeList', $eventTypeColorArray); /* * Set up any additional data transfer to the Template here... */ // now add the data for the Campus Group JumpList $jumpLink = $this->linkValues['jumpLink']; $jumpList = array(); // if ( $this->adminManager->hasSitePriv() ) // { // $jumpList[ $jumpLink.page_ViewStudentYearInSchool::DISPLAY_ALL_ID ] = 'Show All'; // } foreach ($this->monthValues as $key => $value) { $jumpList[$jumpLink . $key] = $value; } $this->template->set('jumpList', $jumpList); // echo '<pre>'.print_r($jumpList,true).'</pre>'; // echo 'jumpLink['.$jumpLink.']<br/>'; $this->template->set('defaultMonth', $jumpLink . $this->month_id); $templateName = 'page_ViewScheduleCalendar.tpl.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_PeoplebyCampuses.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() { // 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 // Disable form? // if ($this->disableForm != true) // { $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->staffactivity_id); $this->formValues['form_name'] = 'scheduledActivityForm'; // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ // Disable form? if ($this->disableForm == true) { $this->template->set('disableForm', $this->disableForm); } /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); $this->template->set('startYear_staffactivity_startdate', 2000); $this->template->set('endYear_staffactivity_startdate', 2010); $this->template->set('startYear_staffactivity_enddate', 2000); $this->template->set('endYear_staffactivity_enddate', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = RowManager_StaffActivityManager::XML_NODE_NAME; $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'staffactivity_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_StaffActivityManager(); if ($this->form_start_date != '' && $this->form_end_date != '') { $dataAccessManager->constructSearchCondition('staffactivity_startdate', '>=', $this->form_start_date, true); $dataAccessManager->constructSearchCondition('staffactivity_enddate', '<=', $this->form_end_date, true); } // if ($this->showOnlyVacation == true) // { // $dataAccessManager->setActivityTypeID('1'); // **HACK** activitytype set to vacation // } if (count($this->activityTypesFilter) > 0) { $activityTypesList = implode(',', $this->activityTypesFilter); $dataAccessManager->addSearchCondition('activitytype_id in (' . $activityTypesList . ')'); // $dataAccessManager->constructSearchCondition('activitytype_id','=',$activityTypesList, true); } $dataAccessManager->setPersonID($this->person_id); $dataAccessManager->setSortOrder($this->sortBy); // $this->dataList = new StaffActivityList( $this->sortBy ); $this->dataList = $dataAccessManager->getListIterator(); // $dataAccessManager $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ $this->template->set('disableHeading', $this->disableHeading); $activitytype = new RowManager_ActivityTypeManager(); // if ($this->showOnlyVacation == true) // { // $activitytype->setActivityTypeID('1'); // **HACK** activitytype set to vacation // } if (count($this->activityTypesFilter) > 0) { $activityTypesList = implode(',', $this->activityTypesFilter); if ($activityTypesList != '') { $activitytype->addSearchCondition('activitytype_id in (' . $activityTypesList . ')'); } } $activitytype->setSortOrder('activitytype_desc'); // $activitytypeList = new ListIterator($activitytype); // $activitytypeArray = $activitytypeList->getDropListArray(); $activitytypeList = $activitytype->getListIterator(); $activitytypeArray = $activitytypeList->getDataList(); foreach (array_keys($activitytypeArray) as $key) { $record = current($activitytypeArray); $colorCode = $record['activitytype_color']; $eventDesc = $record['activitytype_desc']; $activitytypeArray[$key] = '<span style="color:' . $colorCode . ';">' . $eventDesc . '</span>'; next($activitytypeArray); } $this->template->set('list_activitytype_id', $activitytypeArray); /* First check to see whether start date > end date * then check if date matches form date context */ if (isset($this->dateSwitchMessage)) { $this->template->set('date_error_msg', $this->dateSwitchMessage); } else { if (isset($this->dateContextMessage)) { $this->template->set('date_error_msg', $this->dateContextMessage); } } // $templateName = 'siteAdminBox.php'; // if you are creating a custom template for this page then // replace $templateName with the following: $this->template->set('formName', $this->formValues['form_name']); $templateName = 'page_EditStaffActivity.tpl.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 = SITE_PATH_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('[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); // 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); // store the Row Manager's XML Node Name $this->template->set('rowManagerXMLNodeName', RowManager_StaffActivityManager::XML_NODE_NAME); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'staffactivity_id'); // disable the heading? $this->template->set('disableHeading', $this->disableHeading); // Set page sub-heading (i.e. activity type filter) if ($this->activityTypeID != '') { $activityTypes = new RowManager_ActivityTypeManager($this->activityTypeID); $sub_heading = $activityTypes->getActivityTypeDesc(); $this->template->set('subheading', $sub_heading); } /* * Set up any additional data transfer to the Template here... */ $person_manager = new RowManager_PersonManager(); $person_list = $person_manager->getListIterator(); $person_manager->setLabelTemplateLastNameFirstName(); $personArray = $person_list->getDropListArray(); $this->template->set('list_person_id', $personArray); $eventtypes_manager = new RowManager_ActivityTypeManager(); $types_list = $eventtypes_manager->getListIterator(); $typesArray = $types_list->getDropListArray(); $this->template->set('list_activitytype_id', $typesArray); $templateName = 'siteDataList.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_ViewStaffActivities.php'; return $this->template->fetch($templateName); }