function view_generic($strShowInactive = 'true', $strLookupLetter = 'A', $lStartRec = 0, $lRecsPerPage = 50) { //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ global $glChapterID; if (!bTestForURLHack('volMgr')) { return; } $strLookupLetter = urldecode($strLookupLetter); $displayData = array(); $displayData['bShowInactive'] = $bShowInactive = strtoupper($strShowInactive) == 'TRUE'; $displayData['js'] = ''; //------------------------------------------------ // models / libraries / helpers //------------------------------------------------ $this->load->helper('people/people'); $this->load->helper('people/people_display'); $this->load->model('vols/mvol', 'clsVol'); $this->load->model('vols/mvol_skills', 'clsVolSkills'); $this->load->helper('vols/vol'); $this->load->helper('dl_util/time_duration_helper'); $this->load->helper('dl_util/directory'); $this->load->helper('dl_util/rs_navigate'); $this->load->helper('hospice/link_hospice'); $this->load->helper('dl_util/record_view'); $this->load->helper('img_docs/link_img_docs'); $params = array('enumStyle' => 'terse'); $this->load->library('generic_rpt', $params); $this->load->library('util/dl_date_time', '', 'clsDateTime'); //------------------------------------------------ // sanitize the lookup letter //------------------------------------------------ $displayData['strDirLetter'] = $strLookupLetter = strSanitizeLetter($strLookupLetter); // the toggle-a-tizer $strLabelToggle = ($bShowInactive ? '<b>Hide</b>' : '<b>Show</b> active and ') . ' inactive volunteers'; $strLinkEnd = $lStartRec . '/' . $lRecsPerPage; $displayData['strToggleLink'] = anchor('hospice/vols/vol_directory/view/' . ($bShowInactive ? 'false' : 'true') . '/' . ($strLookupLetter == '*' ? '%2A' : $strLookupLetter) . '/' . $strLinkEnd, $strLabelToggle); //------------------------------------------------ // stripes //------------------------------------------------ $this->load->model('util/mbuild_on_ready', 'clsOnReady'); $this->clsOnReady->addOnReadyTableStripes(); $this->clsOnReady->closeOnReady(); $displayData['js'] .= $this->clsOnReady->strOnReady; //------------------------------------------------ // define columns to display //------------------------------------------------ initVolReportDisplay($displayData); $displayData['showFields']->bSkills = true; //------------------------------------------------ // set up directory display //------------------------------------------------ $displayData['strRptTitle'] = 'Volunteer Directory <span style="font-weight: normal;">(' . ($bShowInactive ? 'Active and Inactive' : 'Active Only') . ')</span>'; $displayData['strLinkBase'] = $strLinkBase = 'hospice/vols/vol_directory/view/' . ($bShowInactive ? 'true' : 'false') . '/'; $strWhereExtraReg = " AND vol_lChapterID={$glChapterID} "; $displayData['strDirLetter'] = $strLookupLetter; $displayData['strDirTitle'] = strDisplayDirectory($strLinkBase, ' class="directoryLetters" ', $strLookupLetter, true, $lStartRec, $lRecsPerPage); //------------------------------------------------ // total # people for this letter //------------------------------------------------ $displayData['lNumRecsTot'] = $lNumRecsTot = lNumVolRecsViaLetter($glChapterID, $strLookupLetter, CENUM_CONTEXT_VOLUNTEER, $bShowInactive, $strWhereExtraReg); $displayData['lNumVols'] = $lNumRecsTot; $displayData['strPeopleType'] = 'volunteer'; //------------------------------------------------ // load volunteer directory page //------------------------------------------------ $strWhereExtra = $this->clsVol->strWhereByLetter($strLookupLetter) . $strWhereExtraReg; if (!$bShowInactive) { $strWhereExtra .= ' AND NOT vol_bInactive '; } $this->clsVol->loadVolDirectoryPage($strWhereExtra, $lStartRec, $lRecsPerPage); $displayData['lNumDisplayRows'] = $lNumVols = $this->clsVol->lNumVolRecs; $displayData['directoryRecsPerPage'] = $lRecsPerPage; $displayData['directoryStartRec'] = $lStartRec; if ($lNumVols) { foreach ($this->clsVol->volRecs as $volRec) { $this->clsVolSkills->lVolID = $lVolID = $volRec->lKeyID; $this->clsVolSkills->loadSingleVolSkills(); $volRec->lNumJobSkills = $lNumSkills = $this->clsVolSkills->lNumSingleVolSkills; if ($lNumSkills > 0) { $volRec->volSkills = arrayCopy($this->clsVolSkills->singleVolSkills); } $this->clsVol->loadVolClientAssocViaVolID($lVolID, $volRec->volClient, true); } } $displayData['vols'] =& $this->clsVol->volRecs; //------------------------------------------------ // breadcrumbs / page setup //------------------------------------------------ $displayData['mainTemplate'] = array('hospice/vols/vol_directory_view', 'hospice/vols/rpt_generic_vol_list'); $displayData['pageTitle'] = 'Volunteer Directory'; $displayData['title'] = CS_PROGNAME . ' | Volunteers'; $displayData['nav'] = $this->mnav_brain_jar->navData(); $this->load->vars($displayData); $this->load->view('template'); }
private function importDetailsVolunteers($lImportID, &$displayData, $bViaPTable = false, $logEntry = null) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- //------------------------------------------------ // define columns to display //------------------------------------------------ initVolReportDisplay($displayData); $displayData['showFields']->bSkills = true; if ($this->clsImport->lNumFIDs > 0) { if ($bViaPTable) { $strVIDs = implode(',', $this->clsImport->pTableForeignIDsViaImportID($lImportID, $logEntry->lUTableID, $lNumFIDs)); } else { screamForHelp('Volunteers: invalid import type<br>error on line <b> -- ' . __LINE__ . ' --</b>,<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__); } $strWhereExtra = " AND vol_lKeyID IN ({$strVIDs}) "; $this->clsVol->loadVolDirectoryPage($strWhereExtra, 0, 99999); $displayData['lNumDisplayRows'] = $displayData['lNumVols'] = $lNumVols = $this->clsVol->lNumVolRecs; } if ($lNumVols) { foreach ($this->clsVol->volRecs as $volRec) { $this->clsVolSkills->lVolID = $lVolID = $volRec->lKeyID; $this->clsVolSkills->loadSingleVolSkills(); $volRec->lNumJobSkills = $lNumSkills = $this->clsVolSkills->lNumSingleVolSkills; if ($lNumSkills > 0) { $volRec->volSkills = arrayCopy($this->clsVolSkills->singleVolSkills); } } } $displayData['vols'] =& $this->clsVol->volRecs; $displayData['strRptTitle'] = 'Import Log Details'; $displayData['mainTemplate'] = array('admin/import_summary_view', 'vols/rpt_generic_vol_list'); }
function view_generic($strLookupLetter = 'A', $lStartRec = 0, $lRecsPerPage = 50, $strShowInactive = 'true', $bViaRegFormID, $lRegFormID = null) { //------------------------------------------------------------------------------ // //------------------------------------------------------------------------------ if (!bTestForURLHack('showPeople')) { return; } $strLookupLetter = urldecode($strLookupLetter); $bShowInactive = strtoupper($strShowInactive) == 'TRUE'; $displayData = array(); if ($bViaRegFormID) { $lRegFormID = (int) $lRegFormID; } //------------------------------------------------ // models / libraries / helpers //------------------------------------------------ $this->load->helper('people/people'); $this->load->helper('people/people_display'); $this->load->model('vols/mvol', 'clsVol'); $this->load->model('vols/mvol_skills', 'clsVolSkills'); $this->load->helper('vols/vol'); $this->load->helper('dl_util/time_duration_helper'); $this->load->helper('dl_util/directory'); $this->load->helper('dl_util/rs_navigate'); // $this->load->helper('dl_util/email_web'); $this->load->helper('dl_util/record_view'); $this->load->helper('img_docs/link_img_docs'); $params = array('enumStyle' => 'terse'); $this->load->library('generic_rpt', $params); $this->load->library('util/dl_date_time', '', 'clsDateTime'); $this->load->model('people/mpeople', 'clsPeople'); $this->load->model('admin/madmin_aco', 'clsACO'); //------------------------------------------------ // sanitize the lookup letter //------------------------------------------------ $displayData['strDirLetter'] = $strLookupLetter = strSanitizeLetter($strLookupLetter); //------------------------------------------------ // stripes //------------------------------------------------ $this->load->model('util/mbuild_on_ready', 'clsOnReady'); $this->clsOnReady->addOnReadyTableStripes(); $this->clsOnReady->closeOnReady(); $displayData['js'] = $this->clsOnReady->strOnReady; //------------------------------------------------ // define columns to display //------------------------------------------------ initVolReportDisplay($displayData); $displayData['showFields']->bSkills = true; //------------------------------------------------ // set up directory display //------------------------------------------------ if ($bViaRegFormID) { $this->load->model('vol_reg/mvol_reg', 'volReg'); $this->volReg->loadVolRegFormsViaRFID($lRegFormID); $rRec =& $this->volReg->regRecs[0]; $displayData['strRptTitle'] = 'Volunteer Directory By Registration Form (' . htmlspecialchars($rRec->strFormName) . ')'; $displayData['strLinkBase'] = $strLinkBase = 'volunteers/vol_directory/viewViaRegFormID/' . $lRegFormID . '/'; $strWhereExtraReg = " AND vol_lRegFormID = {$lRegFormID} "; } else { $displayData['strRptTitle'] = 'Volunteer Directory'; $displayData['strLinkBase'] = $strLinkBase = 'volunteers/vol_directory/view/'; $strWhereExtraReg = ''; } $displayData['strDirLetter'] = $strLookupLetter; $displayData['strDirTitle'] = strDisplayDirectory($strLinkBase, ' class="directoryLetters" ', $strLookupLetter, true, $lStartRec, $lRecsPerPage); //------------------------------------------------ // total # people for this letter //------------------------------------------------ $displayData['lNumRecsTot'] = $lNumRecsTot = lNumPeopleRecsViaLetter($strLookupLetter, CENUM_CONTEXT_VOLUNTEER, $bShowInactive, $strWhereExtraReg); $displayData['lNumVols'] = $lNumRecsTot; $displayData['strPeopleType'] = 'volunteer'; //------------------------------------------------ // load volunteer directory page //------------------------------------------------ $strWhereExtra = $this->clsPeople->strWhereByLetter($strLookupLetter, CENUM_CONTEXT_PEOPLE) . $strWhereExtraReg; if (!$bShowInactive) { $strWhereExtra .= ' AND NOT vol_bInactive '; } $this->clsVol->loadVolDirectoryPage($strWhereExtra, $lStartRec, $lRecsPerPage); $displayData['lNumDisplayRows'] = $lNumVols = $this->clsVol->lNumVolRecs; $displayData['directoryRecsPerPage'] = $lRecsPerPage; $displayData['directoryStartRec'] = $lStartRec; if ($lNumVols) { foreach ($this->clsVol->volRecs as $volRec) { $this->clsVolSkills->lVolID = $lVolID = $volRec->lKeyID; $this->clsVolSkills->loadSingleVolSkills(); $volRec->lNumJobSkills = $lNumSkills = $this->clsVolSkills->lNumSingleVolSkills; if ($lNumSkills > 0) { $volRec->volSkills = arrayCopy($this->clsVolSkills->singleVolSkills); } } } $displayData['vols'] =& $this->clsVol->volRecs; //------------------------------------------------ // breadcrumbs / page setup //------------------------------------------------ $displayData['mainTemplate'] = array('vols/vol_directory_view', 'vols/rpt_generic_vol_list'); $displayData['pageTitle'] = anchor('main/menu/vols', 'Volunteers', 'class="breadcrumb"') . ' | Directory'; $displayData['title'] = CS_PROGNAME . ' | Volunteers'; $displayData['nav'] = $this->mnav_brain_jar->navData(); $this->load->vars($displayData); $this->load->view('template'); }