function view($lTagID)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     //      if (!bTestForURLHack('showReports')) return;
     $displayData = array();
     $displayData['js'] = '';
     /*-------------------------------------------------
        models and helpers
       -------------------------------------------------*/
     $this->load->helper('img_docs/img_doc_tags');
     $this->load->model('img_docs/mimage_doc', 'clsImgDoc');
     $this->load->model('img_docs/mimg_doc_tags', 'cidTags');
     $this->load->model('img_docs/mimage_doc_stats', 'cIDStats');
     $this->load->library('util/dl_date_time', '', 'clsDateTime');
     $this->load->helper('dl_util/context');
     $this->load->helper('img_docs/link_img_docs');
     $this->load->helper('dl_util/web_layout');
     $this->cidTags->loadSingleTag($lTagID, $lNumTags, $tagInfo);
     $displayData['tag'] = $tag =& $tagInfo[0];
     $displayData['enumParentContext'] = $enumParentContext = $tag->enumParentContext;
     $displayData['enumEntryType'] = $tag->enumEntryType;
     if (!bPermitViaContext($enumParentContext)) {
         badBoyRedirect('Your permissions do not give you access to these features.');
         return;
     }
     loadSupportModels($enumParentContext, null);
     $lNumParentRecs = $this->cidTags->lNumImgDocTagsViaTagID($lTagID);
     $displayData['strTagTableHeading'] = $this->cIDStats->strTagTableHeaderViaTag($lNumParentRecs, $tag);
     $this->clsImgDoc->loadDocImageInfoViaTagID($lTagID, $enumParentContext);
     $displayData['lNumImageDocs'] = $lNumImageDocs = $this->clsImgDoc->lNumImageDocs;
     if ($lNumImageDocs > 0) {
         $displayData['imageDocs'] =& $this->clsImgDoc->imageDocs;
         foreach ($displayData['imageDocs'] as $img) {
             $img->strTagsUL = $this->cidTags->strImgDocTagsUL($img->lKeyID);
         }
     }
     /*      
           $lNumParentRecs = $this->cidTags->lNumImgDocTagsViaTagID($lTagID);
           $displayData['tagTable'] = $this->cIDStats->strTagTableViaTag($lNumParentRecs, $tag);
     */
     //--------------------------
     // breadcrumbs
     //--------------------------
     $displayData['pageTitle'] = anchor('main/menu/reports', 'Reports', 'class="breadcrumb"') . ' | ' . anchor('reports/image_doc/id_overview/overview', 'Image/Document Overview', 'class="breadcrumb"') . ' | Via Tag';
     $displayData['title'] = CS_PROGNAME . ' | Images/Documents';
     $displayData['nav'] = $this->mnav_brain_jar->navData();
     $displayData['mainTemplate'] = 'img_docs/image_doc_via_tag_view';
     $this->load->vars($displayData);
     $this->load->view('template');
 }
 function optsEandA($lCProgID, $bEnroll, $bActive)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     if (!bTestForURLHack('showClients')) {
         return;
     }
     if ($bEnroll) {
         $strView = 'cprog_enroll_dir_opts_view';
         $strLabel = 'Enrollment';
     } else {
         $strView = 'cprog_attend_dir_opts_view';
         $strLabel = 'Attendance';
     }
     $displayData = array();
     $displayData['js'] = '';
     $displayData['lCProgID'] = $lCProgID = (int) $lCProgID;
     $displayData['bActive'] = $bActive;
     //-------------------------
     // models & helpers
     //-------------------------
     $this->load->model('client_features/mcprograms', 'cprograms');
     $this->load->model('admin/mpermissions', 'perms');
     $this->load->model('personalization/muser_fields', 'clsUF');
     $this->load->helper('clients/link_client_features');
     $this->load->helper('dl_util/web_layout');
     $this->loadClientProgram($displayData, $lCProgID);
     if (!$this->perms->bDoesUserHaveAccess($acctAccess, $cprog->lNumPerms, $cprog->perms)) {
         badBoyRedirect('Your account settings do not allow you to access this client program.');
         return;
     }
     $cprog =& $displayData['cprog'];
     if ($bEnroll) {
         $strETable = $cprog->strEnrollmentTable;
         $strEFNPrefix = $cprog->strETableFNPrefix;
         $this->cprograms->loadBaseEFieldRecs($cprog, $cprog->lNumERecs, $cprog->erecs, ' AND ' . ($bActive ? '' : 'NOT ') . ' ETable.' . $strEFNPrefix . '_bCurrentlyEnrolled ', 'cr_strLName, cr_strFName, ' . $strEFNPrefix . '_dteStart');
     }
     //--------------------------
     // breadcrumbs
     //--------------------------
     $displayData['pageTitle'] = anchor('main/menu/client', 'Clients', 'class="breadcrumb"') . ' | ' . anchor('cprograms/cprog_dir/cprogList', 'Client Programs', 'class="breadcrumb"') . ' | ' . $strLabel;
     $displayData['title'] = CS_PROGNAME . ' | Client Programs';
     $displayData['nav'] = $this->mnav_brain_jar->navData();
     $displayData['mainTemplate'] = 'cprograms/' . $strView;
     $this->load->vars($displayData);
     $this->load->view('template');
 }
예제 #3
0
 function viewEnroll($lCProgID, $bActiveOnly)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $glUserID;
     if (!bTestForURLHack('showClients')) {
         return;
     }
     $this->load->helper('dl_util/verify_id');
     verifyID($this, $lCProgID, 'client program ID');
     $displayData = array();
     $displayData['js'] = '';
     $displayData['lCProgID'] = $lCProgID = (int) $lCProgID;
     $displayData['bActiveOnly'] = $bActiveOnly = $bActiveOnly == 'true';
     //-------------------------
     // models & helpers
     //-------------------------
     $this->load->model('client_features/mcprograms', 'cprograms');
     $this->load->model('personalization/muser_fields', 'clsUF');
     $this->load->model('admin/mpermissions', 'perms');
     $this->load->model('util/mbuild_on_ready', 'clsOnReady');
     $this->load->model('clients/mclients', 'clsClients');
     $this->load->helper('clients/link_client_features');
     $params = array('enumStyle' => 'terse', 'clsRpt');
     $this->load->library('generic_rpt', $params);
     //--------------------------
     // Stripes
     //--------------------------
     $this->clsOnReady->addOnReadyTableStripes();
     $this->clsOnReady->closeOnReady();
     $displayData['js'] .= $this->clsOnReady->strOnReady;
     //-------------------------
     // load the client program
     //-------------------------
     $this->cprograms->loadClientProgramsViaCPID($lCProgID);
     $displayData['cprog'] = $cprog =& $this->cprograms->cprogs[0];
     $displayData['strHTMLSummary'] = $this->cprograms->strHTMLProgramSummaryDisplay(CENUM_CONTEXT_CPROGENROLL);
     $this->perms->loadUserAcctInfo($glUserID, $acctAccess);
     if (!$this->perms->bDoesUserHaveAccess($acctAccess, $cprog->lNumPerms, $cprog->perms)) {
         badBoyRedirect('You do not have access to this client program.');
         return;
     }
     // load the clients associated with this program
     $this->cprograms->clientsEnrolledViaProgID($lCProgID, $cprog, $bActiveOnly, $displayData['lNumClients'], $displayData['clients']);
     if ($displayData['lNumClients'] > 0) {
         foreach ($displayData['clients'] as $client) {
             $lCID = $client->lClientID;
             $this->cprograms->loadBaseERecViaProgClientID($lCID, $cprog, $client->lNumEnrollments, $client->erecs);
             // load sponsorship info
             $this->clsClients->loadSponsorshipInfo($lCID, false, $client->lNumSponsors, $client->sponsors);
             // load cumulative days and hours
             if ($client->lNumEnrollments > 0) {
                 foreach ($client->erecs as $erec) {
                     $lEnrollID = $erec->lKeyID;
                     $erec->lNumDaysAttended = $this->cprograms->lDaysViaEnrollID($cprog, $lEnrollID);
                     $erec->sngNumHours = $this->cprograms->sngHoursViaEnrollID($cprog, $lEnrollID);
                 }
             }
         }
     }
     //--------------------------
     // breadcrumbs
     //--------------------------
     $displayData['pageTitle'] = anchor('main/menu/client', 'Clients', 'class="breadcrumb"') . ' | ' . anchor('cprograms/cprog_dir/cprogList', 'Client Programs', 'class="breadcrumb"') . ' | ' . htmlspecialchars($cprog->strProgramName);
     $displayData['title'] = CS_PROGNAME . ' | Client Programs';
     $displayData['nav'] = $this->mnav_brain_jar->navData();
     $displayData['mainTemplate'] = 'cprograms/cprograms_enrollment_dir_view';
     $this->load->vars($displayData);
     $this->load->view('template');
 }
function bTestForURLHack($enumRequest, $enumType = '')
{
    /*---------------------------------------------------------------------
         if (!bTestForURLHack('adminOnly')) return;
         if (!bTestForURLHack('devOnly')) return;
         if (!bTestForURLHack('editPeopleBizVol')) return;
         if (!bTestForURLHack('showGrants')) return;
         if (!bTestForURLHack('showFinancials')) return;
         if (!bTestForURLHack('dataEntryPeopleBizVol')) return;
         if (!bTestForURLHack('notVolunteer')) return;
         if (!bTestForURLHack('forceFail')) return;
      --------------------------------------------------------------------- */
    global $gbDebug;
    if (!bAllowAccess($enumRequest, $enumType)) {
        badBoyRedirect('Your account settings do not allow you to access this feature.');
        return false;
    } else {
        return true;
    }
}