function configRemRecViewViaType($enumRemType, $lFID, &$displayData)
{
    $lFIDs = array($lFID);
    $CI =& get_instance();
    $CI->load->model('img_docs/mimage_doc', 'clsImgDoc');
    $CI->load->helper('img_docs/image_doc');
    $CI->load->helper('img_docs/link_img_docs');
    $CI->load->model('admin/mpermissions', 'perms');
    switch ($enumRemType) {
        case CENUM_CONTEXT_USER:
            $clsUser = new muser_accts();
            $clsUser->loadSingleUserRecord($lFID);
            $displayData['contextSummary'] = $clsUser->userHTMLSummary(0);
            $displayData['pageTitle'] = strPageTitle('reminderRecordUser', $lFIDs);
            break;
        case CENUM_CONTEXT_PEOPLE:
            $clsPeople = new mpeople();
            $clsPeople->loadPeopleViaPIDs($lFID, false, false);
            $displayData['contextSummary'] = $clsPeople->peopleHTMLSummary(0);
            $displayData['pageTitle'] = strPageTitle('reminderRecordPeople', $lFIDs);
            break;
        case CENUM_CONTEXT_GIFT:
            $clsGifts = new mdonations();
            $clsGifts->loadGiftViaGID($lFID);
            $displayData['contextSummary'] = $clsGifts->giftHTMLSummary();
            $lPeopleBizID = $clsGifts->gifts[0]->gi_lForeignID;
            $lFIDs[1] = $lPeopleBizID;
            if ($clsGifts->gifts[0]->pe_bBiz) {
                $displayData['pageTitle'] = strPageTitle('reminderRecordBizGift', $lFIDs);
            } else {
                $displayData['pageTitle'] = strPageTitle('reminderRecordPeopleGift', $lFIDs);
            }
            break;
        case CENUM_CONTEXT_SPONSORSHIP:
            $clsSpon = new msponsorship();
            $clsSpon->sponsorInfoViaID($lFID);
            $displayData['contextSummary'] = $clsSpon->sponsorshipHTMLSummary();
            $displayData['pageTitle'] = strPageTitle('reminderSponsor', $lFIDs);
            break;
        case CENUM_CONTEXT_CLIENT:
            $clsClients = new mclients();
            $clsClients->loadClientsViaClientID($lFID);
            $displayData['contextSummary'] = $clsClients->strClientHTMLSummary(0);
            $displayData['pageTitle'] = strPageTitle('reminderClient', $lFIDs);
            break;
        case CENUM_CONTEXT_BIZ:
            $clsBiz = new mbiz();
            $clsBiz->loadBizRecsViaBID($lFID);
            $displayData['contextSummary'] = $clsBiz->strBizHTMLSummary();
            $displayData['pageTitle'] = strPageTitle('reminderBiz', $lFIDs);
            break;
        case CENUM_CONTEXT_LOCATION:
        case CENUM_CONTEXT_VOLUNTEER:
        case CENUM_CONTEXT_GENERIC:
        default:
            screamForHelp($enumRemType . ': Switch type not implemented</b><br>error on <b>line:</b> ' . __LINE__ . '<br><b>file:</b> ' . __FILE__ . '<br><b>function:</b> ' . __FUNCTION__);
            break;
    }
}
Exemplo n.º 2
0
 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) . '&nbsp;' . 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, '') . '&nbsp;&nbsp;' . "\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;
 }
Exemplo n.º 4
0
 public function strHTMLOneLineLink($clsSingleRem)
 {
     /*---------------------------------------------------------------------
           sample call:
           $clsRem->loadReminders();
     
           if ($clsRem->lNumReminders > 0){
              foreach ($clsRem->reminders as $clsSingleRem){
                 $strRemLink = $clsRem->strHTMLOneLineLink($clsSingleRem);
              }
           }
        ---------------------------------------------------------------------*/
     global $genumDateFormat;
     $enumRemType = $clsSingleRem->enumSource;
     $lFID = $clsSingleRem->lForeignID;
     switch ($enumRemType) {
         case CENUM_CONTEXT_PEOPLE:
             $people = new mpeople();
             $people->lPeopleID = $lFID;
             $people->peopleInfoLight();
             $strRemLink = 'people reminder for ' . $people->strSafeName . strLinkView_PeopleRecord($lFID, 'View people record', true);
             break;
         case CENUM_CONTEXT_BIZ:
             $clsBiz = new mbiz();
             $clsBiz->lBID = $lFID;
             $clsBiz->bizInfoLight();
             $strRemLink = 'business reminder for ' . $clsBiz->strSafeName . strLinkView_BizRecord($lFID, 'View business record', true);
             break;
         case CENUM_CONTEXT_CLIENT:
             $clsClient = new mclients();
             $clsClient->loadClientsViaClientID($lFID);
             $strRemLink = 'client reminder for ' . $clsClient->clients[0]->strSafeName . ' ' . strLinkView_ClientRecord($lFID, 'View client record', true);
             break;
         case CENUM_CONTEXT_GIFT:
             $clsGifts = new mdonations();
             $clsGifts->loadGiftViaGID($lFID);
             $gift = $clsGifts->gifts[0];
             $strRemLink = 'gift reminder for ' . $gift->strACOCurSymbol . number_format($gift->gi_curAmnt, 2) . ' ' . $gift->strSafeName . ' of ' . date($genumDateFormat, $gift->gi_dteDonation) . ' ' . strLinkView_GiftsRecord($lFID, 'View gift record', true);
             break;
         case CENUM_CONTEXT_USER:
             $clsUser = new muser_accts();
             $clsUser->loadSingleUserRecord($lFID);
             $user =& $clsUser->userRec[0];
             $strRemLink = 'user reminder for ' . $user->strSafeName . ' ' . strLinkView_User($lFID, 'View user record', true);
             break;
         case CENUM_CONTEXT_SPONSORSHIP:
             $cSpon = new msponsorship();
             $cSpon->sponsorInfoViaID($lFID);
             $strRemLink = 'sponsorship reminder for sponsor ' . $cSpon->sponInfo[0]->strSponSafeNameFL . ' ' . strLinkView_Sponsorship($lFID, 'View sponsorship record', true);
             break;
         case CENUM_CONTEXT_LOCATION:
         case CENUM_CONTEXT_VOLUNTEER:
         default:
             screamForHelp($enumRemType . ': Switch type not implemented</b><br>error on <b>line:</b> ' . __LINE__ . '<br><b>file:</b> ' . __FILE__ . '<br><b>function:</b> ' . __FUNCTION__);
             break;
     }
     return $strRemLink;
 }