function loadNameViaContextFID($clsID, $enumContextType, $lFID) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- switch ($enumContextType) { case CENUM_CONTEXT_AUCTION: $cAuction = new mauctions(); $cAuction->loadAuctionByAucID($lFID); $clsID->strName = $cAuction->auctions[0]->strAuctionName; break; case CENUM_CONTEXT_AUCTIONITEM: $cItem = new mitems(); $cItem->loadItemViaItemID($lFID); $clsID->strName = $cItem->items[0]->strItemName; break; case CENUM_CONTEXT_AUCTIONPACKAGE: $cPackage = new mpackages(); $cPackage->loadPackageByPacID($lFID); $clsID->strName = $cPackage->packages[0]->strPackageName; break; case CENUM_CONTEXT_BIZ: $clsBiz = new mbiz(); $clsBiz->loadBizRecsViaBID($lFID); $clsID->strName = $clsBiz->bizRecs[0]->strSafeName; break; case CENUM_CONTEXT_CLIENT: $clsClient = new mclients(); $clsClient->loadClientsViaClientID($lFID); $clsID->strName = $clsClient->clients[0]->strFName . ' ' . $clsClient->clients[0]->strLName; break; case CENUM_CONTEXT_GRANTPROVIDER: $cgrant = new mgrants(); $cgrant->loadGrantProviderViaGPID($lFID, $lNumProviders, $providers); $clsID->strName = $providers[0]->strGrantOrg; break; case CENUM_CONTEXT_INVITEM: $cinv = new minventory(); $cinv->loadSingleInventoryItem($lFID, $lNumItems, $items); $clsID->strName = $items[0]->strItemName; break; case CENUM_CONTEXT_LOCATION: $clsLoc = new mclient_locations(); $clsLoc->loadLocationRec($lFID); $clsID->strName = $clsLoc->strLocation; break; case CENUM_CONTEXT_ORGANIZATION: $clsOrg = new morganization(); $clsOrg->lChapterID = $lFID; $clsOrg->loadChapterInfo(); $clsID->strName = $clsOrg->chapterRec->strSafeChapterName; break; case CENUM_CONTEXT_PEOPLE: $clsPeople = new mpeople(); $clsPeople->loadPeopleViaPIDs($lFID, false, false); $clsID->strName = $clsPeople->people[0]->strFName . ' ' . $clsPeople->people[0]->strLName; break; case CENUM_CONTEXT_SPONSORSHIP: $clsSpon = new msponsorship(); $clsSpon->sponsorInfoViaID($lFID); $clsID->strName = $clsSpon->sponInfo[0]->strSponSafeNameFL; break; case CENUM_CONTEXT_STAFF: $cStaff = new muser_accts(); $clsID->strName = $cStaff->strSafeUserNameViaID($lFID); break; case CENUM_CONTEXT_VOLUNTEER: $clsVol = new mvol(); $clsVol->loadVolRecsViaVolID($lFID, true); $clsID->strName = $clsVol->volRecs[0]->strSafeName; break; case CENUM_CONTEXT_HOUSEHOLD: default: screamForHelp($enumContextType . ': not implemented yet<br>error on line ' . __LINE__ . ',<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__); break; } }
function logDisplay($enumTType, $lFieldID, $lTableID, $lForeignID, $lNumLoad) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat, $gstrSeed; $strOut = ''; $clsUsers = new muser_accts(); $this->lNumTotLogEntries = $this->lCntLogEntries($lFieldID, $lForeignID); $this->lNumLogEntriesDisplayed = min($this->lNumTotLogEntries, $lNumLoad); $strTableName = $this->strGenUF_Log_TableName($lTableID); $strOut .= strLinkAdd_UFLogEntry($enumTType, $lFieldID, $lTableID, $lForeignID, true, 'Add new log entry', '') . " Displaying {$this->lNumLogEntriesDisplayed} of {$this->lNumTotLogEntries} log entries"; if ($this->lNumLogEntriesDisplayed > 0) { //------------------------ // more to display? //------------------------ if ($this->bShowViewAllLog) { $strOut .= ' ' . strLinkView_UFAllLogEntries($lTableID, $lFieldID, $lForeignID, 'View all', true) . ' ' . strLinkView_UFAllLogEntries($lTableID, $lFieldID, $lForeignID, 'View all', false, 'valign="top";'); } $strOut .= '<br><br>'; $this->loadLogEntries($lFieldID, $lForeignID, $this->lNumLogEntriesDisplayed, $this->lMaxLogDisplayLen); foreach ($this->logEntries as $logEntry) { $lLogEntryID = $logEntry->lKeyID; if ($this->bShowLogEditLinks) { $strOut .= strLinkEdit_UFLogEntry($enumTType, $lTableID, $lFieldID, $lForeignID, $lLogEntryID, 'Edit log entry', true, '') . ' ' . "\n" . strLinkRem_UFLogEntry($enumTType, $lTableID, $lFieldID, $lForeignID, $lLogEntryID, 'remove log entry', true, true); // ' onClick="return(confirm(\'Are you sure you want to remove this log entry? ' // .'The action can not be undone.\'));" '); } $strOut .= '<table class="ufLogs"><tr><td>'; if ($logEntry->strTitle . '' != '') { $strOut .= '<b>' . htmlspecialchars($logEntry->strTitle) . '</b> '; } $strOut .= '(' . date($genumDateFormat, $logEntry->dteOrigin) . ')<br>'; $strElipsis = $logEntry->lEntryLen > $this->lMaxLogDisplayLen ? '....' : ''; $strOut .= nl2br(htmlspecialchars($logEntry->strLogEntry)) . $strElipsis . '<br><br>'; $strOut .= '<small><u>logged by ' . $clsUsers->strSafeUserNameViaID($logEntry->lOriginID) . ' on ' . date($genumDateFormat . ' H:i:s', $logEntry->dteOrigin) . '</u><br></small>'; $strOut .= '<small><u>last updated by ' . $clsUsers->strSafeUserNameViaID($logEntry->lLastUpdateID) . ' on ' . date($genumDateFormat . ' H:i:s', $logEntry->dteLastUpdate) . '</u><br></small>'; $strOut .= '</td></tr></table><br>'; } } return $strOut; }