function setClientProgFields(&$displayData, &$bClientProg, &$lCProgID, &$cprog, $enumTType, $lTableID) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $CI =& get_instance(); $displayData['bClientProg'] = $bClientProg = bTypeIsClientProg($enumTType); // ==CENUM_CONTEXT_CPROGENROLL || $enumTType==CENUM_CONTEXT_CPROGATTEND; if ($bClientProg) { $CI->load->model('client_features/mcprograms', 'cprograms'); $CI->load->helper('clients/link_client_features'); $displayData['bEnrollment'] = $bEnrollment = $enumTType == CENUM_CONTEXT_CPROGENROLL; if ($bEnrollment) { $CI->cprograms->loadClientProgramsViaETableID($lTableID); } else { $CI->cprograms->loadClientProgramsViaATableID($lTableID); } $cprog = $CI->cprograms->cprogs[0]; $lCProgID = $cprog->lKeyID; $displayData['strTableLabel'] = ($bEnrollment ? 'Enrollment ' : 'Attendance ') . ' table: ' . htmlspecialchars($cprog->strProgramName); $displayData['entrySummary'] = $CI->cprograms->strHTMLProgramSummaryDisplay($enumTType); } else { $cprog = null; $displayData['strTableLabel'] = htmlspecialchars($CI->clsUF->userTables[0]->strUserTableName); // htmlspecialchars($userTable->strUserTableName); $displayData['entrySummary'] = $CI->clsUF->strUFTableSummaryDisplay(true); } }
function removeRecord($lTableID, $lFID, $lRecID) { //------------------------------------------------------------------------- // //------------------------------------------------------------------------- $this->load->helper('dl_util/verify_id'); if (!vid_bUserTableIDExists($this, $lTableID, $enumTabType)) { vid_bTestFail($this, false, 'user table ID', $lTableID); } verifyIDsViaType($this, $enumTabType, $lFID, false); $lEnrollID = 0; //------------------------- // models & helpers //------------------------- $this->load->model('personalization/muser_fields', 'clsUF'); $this->load->model('personalization/muser_fields_display', 'clsUFD'); $this->load->model('admin/mpermissions', 'perms'); $this->load->helper('clients/client_program'); $this->clsUFD->lTableID = $lTableID; $this->clsUFD->loadTableViaTableID(); $utable =& $this->clsUFD->userTables[0]; $enumTType = $utable->enumTType; $bCProg = bTypeIsClientProg($enumTType); $bEnrollment = $enumTType == CENUM_CONTEXT_CPROGENROLL; // if deleting an enrollment record, we must also delete // any associated attendance records if ($bCProg) { $this->load->model('client_features/mcprograms', 'cprograms'); if ($bEnrollment) { $this->cprograms->loadClientProgramsViaETableID($lTableID); $cprog =& $this->cprograms->cprogs[0]; $strATable = $cprog->strAttendanceTable; $strATableFNPre = $cprog->strATableFNPrefix; $this->cprograms->deleteATableRecsViaEnrollRecID($strATable, $strATableFNPre, $lRecID); } else { // load the enrollment record to provide the proper return path $this->cprograms->loadClientProgramsViaATableID($lTableID); $cprog =& $this->cprograms->cprogs[0]; $this->cprograms->loadBaseARecViaARecID($cprog, $lRecID, $lNumARecs, $arecs); $lEnrollID = $arecs[0]->lEnrollID; } $strTableLabel = 'An ' . ($bEnrollment ? 'enrollment' : 'attendance') . ' record was removed from client program <b>' . htmlspecialchars($cprog->strProgramName) . '</b>.'; } else { $strTableLabel = 'The selected record was removed from ' . 'table <b>' . htmlspecialchars($utable->strUserTableName) . '</b>'; } $this->clsUFD->removeMRRecord($lRecID); $this->session->set_flashdata('msg', $strTableLabel); redirect('admin/uf_multirecord_view/viewMRViaFID/' . $lTableID . '/' . $lFID . '/' . $lEnrollID); }
function viewSingleMR($lTableID, $lFID, $lRecID) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat; $displayData = array(); $displayData['js'] = ''; //------------------------- // models & helpers //------------------------- $this->load->helper('dl_util/time_date'); $params = array('enumStyle' => 'terse'); $this->load->library('generic_rpt', $params); $this->load->model('admin/madmin_aco', 'clsACO'); $this->load->model('personalization/muser_fields', 'clsUF'); $this->load->model('personalization/muser_fields_display', 'clsUFD'); $this->load->model('admin/mpermissions', 'perms'); $this->load->model('clients/mclients', 'clsClients'); $this->load->helper('dl_util/context'); $this->load->helper('dl_util/web_layout'); $this->load->helper('clients/client_program'); $this->load->helper('clients/link_client_features'); $this->load->library('util/dl_date_time', '', 'clsDateTime'); $this->load->helper('js/div_hide_show'); $displayData['js'] .= showHideDiv(); //--------------------------------------------------- // load personalized table and field definitions //--------------------------------------------------- $displayData['lTableID'] = $this->clsUFD->lTableID = $lTableID; $displayData['lFID'] = $this->clsUFD->lForeignID = $lFID; $displayData['lRID'] = $lRecID; $this->clsUFD->loadTableViaTableID(); $displayData['utable'] = $utable =& $this->clsUFD->userTables[0]; $displayData['bCollapseHeadings'] = $utable->bCollapsibleHeadings; $displayData['bCollapseDefaultHide'] = $utable->bCollapseDefaultHide; $displayData['bMultiEntry'] = $bMultiEntry = $utable->bMultiEntry; // load field schema info $this->clsUFD->loadFieldsGeneric(true, $lTableID, null); $utable->lNumFields = $this->clsUFD->lNumFields; $utable->ufields = $ufields =& $this->clsUFD->fields; $enumTType = $utable->enumTType; loadSupportModels($enumTType, $lFID); // Client program? (special type of multi-record personalized table, always associated with client) $displayData['lEnrollRecID'] = 0; $displayData['bCProg'] = $displayData['utable']->bCProg = $bCProg = bTypeIsClientProg($enumTType); if ($bCProg) { $this->load->model('client_features/mcprograms', 'cprograms'); $displayData['bEnrollment'] = $displayData['utable']->bEnrollment = $bEnrollment = $enumTType == CENUM_CONTEXT_CPROGENROLL; $displayData['cprogType'] = $cprogType = $enumTType; $enumTType = CENUM_CONTEXT_CLIENT; if ($bEnrollment) { $this->cprograms->loadClientProgramsViaETableID($lTableID); $displayData['cprog'] = $cprog =& $this->cprograms->cprogs[0]; $this->cprograms->loadBaseERecViaERecID($cprog, $lRecID, $displayData['lNumERecs'], $displayData['erecs']); } else { $this->cprograms->loadClientProgramsViaATableID($lTableID); $displayData['cprog'] = $cprog =& $this->cprograms->cprogs[0]; $this->cprograms->loadBaseARecViaARecID($cprog, $lRecID, $displayData['lNumARecs'], $displayData['arecs']); $displayData['lEnrollRecID'] = $lEnrollRecID = $displayData['arecs'][0]->lEnrollID; $this->cprograms->loadBaseERecViaERecID($cprog, $lEnrollRecID, $lNumERecs, $erecs); $erec =& $erecs[0]; } $displayData['strTableLabel'] = ($bEnrollment ? $cprog->strSafeEnrollLabel : $cprog->strSafeAttendLabel) . ' record: ' . htmlspecialchars($cprog->strProgramName); if (!$bEnrollment) { $displayData['strTableLabel'] .= '<br><span style="font-size: 9pt; font-weight: normal;">' . '(Enrollment: ' . date($genumDateFormat, $erec->dteStart) . ' - ' . (is_null($erec->dteMysqlEnd) ? 'ongoing' : date($genumDateFormat, $erec->dteEnd)) . ')</span>'; } } else { $displayData['strTableLabel'] = htmlspecialchars($utable->strUserTableName); } // load single data record $this->clsUFD->loadMRRecsViaRID($lRecID); $displayData['lNumMRRecs'] = $this->clsUFD->lNumMRRecs; $displayData['mRec'] = $mRec =& $this->clsUFD->mrRecs[0]; // if there are any multi-select ddls, create an ordered list // for clientID's load the client's name $displayData['clientNames'] = array(); foreach ($ufields as $uf) { if ($uf->enumFieldType == CS_FT_DDLMULTI) { $strMDDLFN = $uf->strFieldNameInternal . '_ddlMulti'; $mRec->{$strMDDLFN}->strUL = $this->clsUFD->strMultiDDLUL($mRec->{$strMDDLFN}); } elseif ($uf->enumFieldType == CS_FT_CLIENTID) { $strFN = $uf->strFieldNameInternal; $lClientID = (int) $mRec->{$strFN}; if ($lClientID > 0) { $this->clsClients->loadClientsViaClientID($lClientID); $client =& $this->clsClients->clients[0]; $displayData['clientNames'][$lClientID] = $client->strFName . ' ' . $client->strLName; } } } //-------------------------- // breadcrumbs //-------------------------- $this->clsUFD->tableContext(0); $this->clsUFD->tableContextRecView(0); $displayData['strHTMLSummary'] = $this->clsUFD->strHTMLSummary; $displayData['pageTitle'] = $this->clsUFD->strBreadcrumbsTableDisplay(0); $displayData['title'] = CS_PROGNAME . ' | Personalization'; $displayData['nav'] = $this->mnav_brain_jar->navData(); $displayData['mainTemplate'] = 'personalization/uf_multi_rec_single_view'; $this->load->vars($displayData); $this->load->view('template'); }