コード例 #1
0
 function view($enumContextType, $enumEntryType, $lFID)
 {
     //------------------------------------------------------------------------------
     //
     //------------------------------------------------------------------------------
     $this->load->helper('dl_util/verify_id');
     verifyIDsViaType($this, $enumContextType, $lFID, false);
     $displayData = array();
     $displayData = array();
     $displayData['lFID'] = $lFID = (int) $lFID;
     $displayData['enumContextType'] = $enumContextType;
     $displayData['enumEntryType'] = $enumEntryType;
     $displayData['bImage'] = $bImage = $enumEntryType == CENUM_IMGDOC_ENTRY_IMAGE;
     $displayData['bUpdate'] = false;
     $strLabel = $bImage ? 'Image' : 'Document';
     //-------------------------
     // models & helpers
     //-------------------------
     $params = array('enumStyle' => 'terse');
     $this->load->library('generic_rpt', $params);
     $this->load->library('util/dl_date_time', '', 'clsDateTime');
     $this->load->model('img_docs/mimage_doc', 'clsImgDoc');
     $this->load->model('img_docs/mimg_doc_tags', 'cidTags');
     $this->load->helper('dl_util/web_layout');
     $this->load->helper('auctions/auction');
     $this->load->helper('dl_util/record_view');
     $this->load->helper('img_docs/link_img_docs');
     $this->load->helper('dl_util/time_date');
     $this->load->helper('dl_util/context');
     $this->load->helper('img_docs/image_doc');
     $this->load->helper('img_docs/link_img_docs');
     $this->load->helper('img_docs/img_doc_tags');
     loadSupportModels($enumContextType, $lFID);
     $this->clsImgDoc->loadDocImageInfoViaEntryContextFID($enumEntryType, $enumContextType, $lFID);
     $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);
         }
     }
     //--------------------------
     // breadcrumbs
     //--------------------------
     $displayData['contextSummary'] = strContextHTML($enumContextType, $lFID, $displayData['strContextName']);
     $displayData['pageTitle'] = breadCrumbsToRecViewViaContextType($enumContextType, $lFID, 'View ' . $strLabel . 's');
     $displayData['title'] = CS_PROGNAME . ' | ' . $strLabel . 's';
     $displayData['nav'] = $this->mnav_brain_jar->navData();
     $displayData['mainTemplate'] = 'img_docs/view_image_docs_view';
     $this->load->vars($displayData);
     $this->load->view('template');
 }
コード例 #2
0
 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');
 }
コード例 #3
0
 function addFromCForm($lParentID, $lCFID)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $gErrMessages, $gbShowHiddenVerifyError;
     $this->load->helper('dl_util/verify_id');
     verifyID($this, $lCFID, 'custom form ID');
     $displayData = array();
     $displayData['js'] = '';
     $displayData['lCFID'] = $lCFID = (int) $lCFID;
     $displayData['lParentID'] = $lParentID = (int) $lParentID;
     $gbShowHiddenVerifyError = false;
     $gErrMessages = array();
     /*------------------------------------------------
           models/libraries/helpers
       ------------------------------------------------*/
     $params = array('enumStyle' => 'terse');
     $this->load->library('generic_rpt', $params);
     $this->load->model('custom_forms/mcustom_forms', 'cForm');
     $this->load->model('personalization/muser_fields', 'clsUF');
     $this->load->model('personalization/muser_fields_display', 'clsUFD');
     $this->load->model('admin/madmin_aco', 'clsACO');
     $this->load->model('admin/mpermissions', 'perms');
     $this->load->helper('dl_util/context');
     $this->load->helper('dl_util/custom_forms');
     $this->load->helper('dl_util/time_date');
     $this->load->library('util/dl_date_time', '', 'clsDateTime');
     // load the custom form
     $this->cForm->loadCustomFormsViaCFID($lCFID);
     $displayData['cForm'] = $cForm =& $this->cForm->customForms[0];
     $enumType = $cForm->enumContextType;
     // now that the context is known, verify the parent ID
     verifyIDsViaType($this, $enumType, $lParentID, true);
     // custom verification ?
     $displayData['bCusVerification'] = $bCusVerification = $cForm->strVerificationModule . '' != '';
     //-----------------------------
     // validation rules
     //-----------------------------
     $this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
     if ($bCusVerification) {
         $this->load->helper('path');
         $this->form_validation->set_rules('hVerify', 'Hidden verification', 'callback_hiddenVerify[' . $cForm->strVerificationModule . ',' . $cForm->strVModEntryPoint . ']');
     }
     // personalized tables and associated fields
     $this->cForm->loadPTablesForDisplay($lCFID, $this->clsUF);
     $displayData['utables'] = $utables =& $this->cForm->utables;
     $displayData['lNumTables'] = $lNumTables = $this->cForm->lNumTables;
     setValidationUTables($displayData['js'], $lNumTables, $utables);
     if ($this->form_validation->run() == FALSE) {
         $this->load->library('generic_form');
         $this->load->model('util/mlist_generic', 'clsList');
         $this->load->helper('dl_util/web_layout');
         loadSupportModels($enumType, $lParentID);
         initUTableDates($displayData['js'], $lNumTables, $utables);
         initUTableDDLs($lNumTables, $utables);
         if (validation_errors() == '') {
             populateCustomTables($lNumTables, $utables, $lParentID);
             setCustomUTableDDLs($lNumTables, $utables);
         } else {
             setOnFormError($displayData);
             repopulateCustomTables($lNumTables, $utables);
         }
         //--------------------------
         // breadcrumbs
         //--------------------------
         $displayData['pageTitle'] = $this->cForm->strCustomFormsPageTitleAddEdit($enumType, $cForm->strFormName);
         $displayData['strHTMLSummary'] = strContextHTML($enumType, $lParentID, $enumType);
         $displayData['errMessages'] = arrayCopy($gErrMessages);
         $displayData['title'] = CS_PROGNAME . ' | Custom Forms';
         $displayData['nav'] = $this->mnav_brain_jar->navData();
         $displayData['mainTemplate'] = array('custom_forms/custom_form_data_entry_view');
         $this->load->vars($displayData);
         $this->load->view('template');
     } else {
         saveCustomPTables($lParentID, $lNumTables, $utables);
         $this->cForm->lLogFormSave($lParentID, $lCFID);
         $this->fromWhenceYeCame($lParentID, $enumType, $cForm);
     }
 }
コード例 #4
0
 function edit($lImageDocID)
 {
     //------------------------------------------------------------------------------
     //
     //------------------------------------------------------------------------------
     global $gstrFormatDatePicker, $gbDateFormatUS;
     $this->load->helper('dl_util/verify_id');
     verifyID($this, $lImageDocID, 'image/document ID');
     $displayData = array();
     $displayData['formData'] = new stdClass();
     $displayData['lImageDocID'] = $lImageDocID = (int) $lImageDocID;
     $displayData['bUpdate'] = true;
     //-------------------------
     // models & helpers
     //-------------------------
     $params = array('enumStyle' => 'terse');
     $this->load->library('generic_rpt', $params);
     $this->load->library('util/dl_date_time', '', 'clsDateTime');
     $this->load->model('img_docs/mimage_doc', 'clsImgDoc');
     $this->load->model('admin/mpermissions', 'perms');
     $this->load->helper('auctions/auction');
     $this->load->helper('dl_util/time_date');
     $this->load->helper('dl_util/context');
     $this->load->helper('img_docs/image_doc');
     $this->load->helper('img_docs/link_img_docs');
     $displayData['enumContextType'] = $enumContextType = $this->clsImgDoc->enumContextViaID($lImageDocID);
     $displayData['lFID'] = $lFID = $this->clsImgDoc->lForeignIDViaID($lImageDocID);
     $displayData['enumEntryType'] = $enumEntryType = $this->clsImgDoc->enumEntryTypeViaID($lImageDocID);
     $displayData['bImage'] = $bImage = $enumEntryType == CENUM_IMGDOC_ENTRY_IMAGE;
     $strLabel = $bImage ? 'Image' : 'Document';
     loadSupportModels($enumContextType, $lFID);
     $this->clsImgDoc->loadDocImageInfoViaID($lImageDocID);
     $imgDoc =& $this->clsImgDoc->imageDocs[0];
     $enumIDContext = imgDocTags\xlateTagTypeViaContextType($enumContextType, $enumEntryType);
     $displayData['strTagLabel'] = imgDocTags\strXlateImgDocContext($enumIDContext);
     $this->cidTags->loadImgDocTagsForDDL($enumIDContext, $lImageDocID, $displayData['lNumTags'], $displayData['tags']);
     //-------------------------
     // validation rules
     //-------------------------
     $this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
     $this->form_validation->set_rules('txtDescription', 'Description', 'trim');
     $this->form_validation->set_rules('txtCaption', 'Caption', 'trim');
     $this->form_validation->set_rules('txtDate', 'Date of ' . $strLabel, 'trim|required|' . 'callback_clientImageUploadVerifyBDateValid');
     if ($bImage) {
         $this->form_validation->set_rules('chkProfile', 'Profile', 'trim');
     }
     if ($this->form_validation->run() == FALSE) {
         $this->load->helper('dl_util/web_layout');
         $this->load->library('generic_form');
         if ($bImage) {
             $displayData['strImageTag'] = strLinkHTMLTag($enumContextType, $enumEntryType, $lFID, $imgDoc->strSystemFN, 'View in new window', true, '') . strImageHTMLTag($enumContextType, $enumEntryType, $lFID, $imgDoc->strSystemThumbFN, '', false, ' style="border: 1px solid black;" ') . '</a>';
         } else {
             $displayData['strImageTag'] = '';
         }
         // first time displayed, no user data entry errors
         if (validation_errors() == '') {
             $displayData['formData']->txtDate = date($gstrFormatDatePicker, $imgDoc->dteDocImage);
             $displayData['formData']->txtDescription = htmlspecialchars($imgDoc->strDescription);
             $displayData['formData']->txtCaption = htmlspecialchars($imgDoc->strCaptionTitle);
             if ($bImage) {
                 $displayData['formData']->bProfile = $imgDoc->bProfile;
             }
         } else {
             setOnFormError($displayData);
             $displayData['formData']->txtDate = set_value('txtDate');
             $displayData['formData']->txtDescription = set_value('txtDescription');
             $displayData['formData']->txtCaption = set_value('txtCaption');
             $this->updateTagSelect($displayData['lNumTags'], $displayData['tags']);
             if ($bImage) {
                 $displayData['formData']->bProfile = set_value('chkProfile') == 'TRUE';
             }
         }
         $displayData['contextSummary'] = strContextHTML($enumContextType, $lFID, $displayData['strContextName']);
         //--------------------------
         // breadcrumbs
         //--------------------------
         $displayData['pageTitle'] = breadCrumbsToRecViewViaContextType($enumContextType, $lFID, 'Update ' . $strLabel);
         $displayData['title'] = CS_PROGNAME . ' | Clients';
         $displayData['nav'] = $this->mnav_brain_jar->navData();
         $displayData['mainTemplate'] = 'img_docs/upload_image_doc_view';
         $this->load->vars($displayData);
         $this->load->view('template');
     } else {
         $this->load->model('img_docs/mimage_doc', 'clsImgDoc');
         if ($bImage) {
             $this->load->library('image_lib');
         }
         $this->clsImgDoc->loadDocImageInfoViaID(-1);
         $imageDoc =& $this->clsImgDoc->imageDocs[0];
         $bProfile = @$_POST['chkProfile'] == 'TRUE';
         $strDate = trim($_POST['txtDate']);
         MDY_ViaUserForm($strDate, $lMon, $lDay, $lYear, $gbDateFormatUS);
         $dteMySQLDate = strMoDaYr2MySQLDate($lMon, $lDay, $lYear);
         //         $uploadResults = $_SESSION[CS_NAMESPACE.'uploadResults'];
         $enumEntryType = $bImage ? CENUM_IMGDOC_ENTRY_IMAGE : CENUM_IMGDOC_ENTRY_PDF;
         $imageDoc->enumEntryType = $enumEntryType;
         $imageDoc->enumContextType = $enumContextType;
         $imageDoc->lForeignID = $lFID;
         $imageDoc->strCaptionTitle = trim($_POST['txtCaption']);
         $imageDoc->strDescription = trim($_POST['txtDescription']);
         $imageDoc->dteMysqlDocImage = $dteMySQLDate;
         $imageDoc->bProfile = $bProfile;
         // tags
         $this->setUserSelectedTagsFromPost($lImageDocID);
         $this->clsImgDoc->updateDocImageRec($lImageDocID);
         if ($bImage && $bProfile) {
             $this->clsImgDoc->setProfileFlag($lImageDocID, $enumContextType, $lFID);
         }
         $this->session->set_flashdata('msg', 'The ' . $strLabel . ' information was updated');
         redirectViaContextType($enumContextType, $lFID);
     }
 }
コード例 #5
0
 function viewLogEntries($lTableID, $lLogFieldID, $lForeignID)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $displayData = array();
     $displayData['lTableID'] = $lTableID = (int) $lTableID;
     $displayData['lLogFieldID'] = $lLogFieldID = (int) $lLogFieldID;
     $displayData['lForeignID'] = $lForeignID = (int) $lForeignID;
     //------------------------------------------------
     // libraries and utilities
     //------------------------------------------------
     $this->load->model('personalization/muser_fields', 'clsUF');
     $this->load->model('personalization/muser_fields_display', 'clsUFD');
     $this->load->model('admin/mpermissions', 'perms');
     $this->load->model('admin/madmin_aco');
     $this->load->library('util/dl_date_time', '', 'clsDateTime');
     $params = array('enumStyle' => 'enpRptC');
     $this->load->library('generic_rpt', $params);
     $this->load->model('admin/muser_accts', 'clsUser');
     $this->load->helper('dl_util/context');
     $this->clsUFD->lTableID = $lTableID;
     $this->clsUFD->lForeignID = $lForeignID;
     $this->clsUFD->loadTableViaTableID();
     $userTable =& $this->clsUFD->userTables[0];
     $enumTType = $userTable->enumTType;
     $this->clsUFD->loadFieldsGeneric(false, $lTableID, $lLogFieldID);
     //      $this->clsUF->loadSupportModels($enumTType, $lForeignID);
     loadSupportModels($enumTType, $lForeignID);
     $this->clsUFD->tableContext(0);
     $this->clsUFD->tableContextRecView(0);
     $displayData['strTTypeLabel'] = $this->clsUFD->strTTypeLabel;
     $displayData['strUserTableName'] = $userTable->strUserTableName;
     $displayData['pff_strFieldNameUser'] = $this->clsUFD->fields[0]->pff_strFieldNameUser;
     $this->clsUFD->bShowViewAllLog = false;
     $this->clsUFD->bShowLogEditLinks = true;
     $this->clsUFD->lMaxLogDisplayLen = 999999;
     $displayData['strLogEntries'] = $this->clsUFD->logDisplay($this->clsUFD->enumTType, $lLogFieldID, $lTableID, $lForeignID, 999999);
     //------------------------------------------------
     // breadcrumbs / page setup
     //------------------------------------------------
     $displayData['title'] = CS_PROGNAME . ' | Personalized Fields';
     $displayData['pageTitle'] = $this->clsUFD->strBreadcrumbsTableDisplay(0);
     $displayData['nav'] = $this->mnav_brain_jar->navData();
     $displayData['contextSummary'] = $this->clsUFD->strHTMLSummary;
     $displayData['mainTemplate'] = 'admin/user_table_log_view';
     $this->load->vars($displayData);
     $this->load->view('template');
 }
コード例 #6
0
 private function docImageSearch(&$results)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     global $genumDateFormat;
     $results->strLabel = 'Image and Document Descriptions';
     $results->lNumResults = 0;
     $sqlStr = 'SELECT
            di_lKeyID, di_enumEntryType, di_enumContextType,
            di_lForeignID, di_strCaptionTitle, di_strDescription,
            di_dteDocImage, di_strUserFN
         FROM docs_images
         WHERE NOT di_bRetired AND ' . $this->textSearchWhere('di_strDescription') . '
         ORDER BY di_enumContextType, di_lForeignID, di_lKeyID;';
     $query = $this->db->query($sqlStr);
     $results->lNumResults = $lNumRows = $query->num_rows();
     if ($lNumRows > 0) {
         $idx = 0;
         $results->matches = array();
         $bModelLoaded = array();
         foreach ($query->result() as $row) {
             $enumContext = $row->di_enumContextType;
             $enumEntryType = $row->di_enumEntryType;
             $lForeignID = $row->di_lForeignID;
             if (!isset($bModelLoaded[$enumContext])) {
                 $bModelLoaded[$enumContext] = true;
                 loadSupportModels($enumContext, $lForeignID);
             }
             $results->matches[$idx] = new stdClass();
             $match =& $results->matches[$idx];
             $match->searchInfo = strLabelViaContextType($enumContext, true, false) . ' / ' . $enumEntryType;
             contextNameLink($enumContext, $lForeignID, $strContextName, $strContextLink);
             $match->links = $strContextLink . ' ' . htmlspecialchars($strContextName);
             $match->text = $row->di_strDescription;
             $match->textHighlighted = $this->highlightMatchedText($row->di_strDescription);
             ++$idx;
         }
     }
 }
コード例 #7
0
 public function addEditMultiRecord($lTableID, $lFID, $lRecID = 0, $lEnrollRecID = 0, $bUseReturnPath = 'false')
 {
     //-------------------------------------------------------------------------
     // $lEnrollRecID is only used when working with client program attendance
     // records. It links to the parent enrollment table entry.
     //-------------------------------------------------------------------------
     global $gbDateFormatUS, $gErrMessages, $gbShowHiddenVerifyError;
     global $genumDateFormat;
     global $glTableID;
     $displayData = array();
     $displayData['js'] = '';
     $gErrMessages = array();
     $bEnrollment = false;
     $gbShowHiddenVerifyError = false;
     $bUseReturnPath = $bUseReturnPath == 'true';
     //-------------------------
     // models & helpers
     //-------------------------
     $this->load->helper('dl_util/time_date');
     // for date verification
     $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('personalization/muser_schema', 'cUFSchema');
     $this->load->model('admin/mpermissions', 'perms');
     $this->load->helper('dl_util/context');
     $this->load->helper('dl_util/web_layout');
     $this->load->helper('clients/client_program');
     $this->load->library('util/dl_date_time', '', 'clsDateTime');
     $this->load->helper('js/div_hide_show');
     $displayData['js'] .= showHideDiv();
     $this->load->helper('dl_util/verify_id');
     if (!vid_bUserTableIDExists($this, $lTableID, $enumTType)) {
         vid_bTestFail($this, false, 'user table ID', $lTableID);
     }
     $glTableID = $lTableID;
     // Client program? (special type of multi-record personalized table, always associated with client)
     $displayData['bCProg'] = $bCProg = bTypeIsClientProg($enumTType);
     if ($bCProg) {
         $this->load->model('client_features/mcprograms', 'cprograms');
         $displayData['bEnrollment'] = $bEnrollment = $enumTType == CENUM_CONTEXT_CPROGENROLL;
         $displayData['cprogType'] = $cprogType = $enumTType;
         $enumTType = CENUM_CONTEXT_CLIENT;
     }
     verifyIDsViaType($this, $enumTType, $lFID, false);
     $displayData['lTableID'] = $lTableID = (int) $lTableID;
     $displayData['lFID'] = $lFID = (int) $lFID;
     $displayData['lRecID'] = $lRecID = (int) $lRecID;
     $displayData['lEnrollRecID'] = $lEnrollRecID = (int) $lEnrollRecID;
     $displayData['bNew'] = $bNew = $lRecID == 0;
     $displayData['bUseReturnPath'] = $bUseReturnPath;
     //---------------------------------------------------
     // load personalized table and field definitions
     //---------------------------------------------------
     $this->clsUFD->lTableID = $lTableID;
     $this->clsUFD->lForeignID = $lFID;
     $this->clsUFD->loadTableViaTableID();
     $displayData['utable'] = $utable =& $this->clsUFD->userTables[0];
     $this->clsUFD->loadFieldsGeneric(true, $lTableID, null);
     $utable->lNumFields = $lNumFields = $this->clsUFD->lNumFields;
     $utable->lNumEditableFields = $lNumEditableFields = $this->clsUFD->lNumEditableFields;
     $utable->bAnyPrefill = $bAnyPrefill = $this->clsUFD->bAnyPrefillFields();
     $utable->bCProg = $bCProg;
     $utable->bEnrollment = $bEnrollment;
     $displayData['bCusVerification'] = $bCusVerification = false;
     $displayData['strSafeAttendLabel'] = $displayData['strSafeEnrollLabel'] = '';
     if ($bCProg) {
         if ($bEnrollment) {
             $this->cprograms->loadClientProgramsViaETableID($lTableID);
         } else {
             $utable->bHideDuration = false;
             $this->cprograms->loadClientProgramsViaATableID($lTableID);
             $utable->lEnrollRecID = $lEnrollRecID;
         }
         $cprog =& $this->cprograms->cprogs[0];
         $displayData['strSafeAttendLabel'] = $cprog->strSafeAttendLabel;
         $displayData['strSafeEnrollLabel'] = $cprog->strSafeEnrollLabel;
         $lCProgID = $cprog->lKeyID;
         if ($bEnrollment) {
             $this->cprograms->loadBaseERecViaERecID($cprog, $lRecID, $utable->lNumERecs, $utable->erecs);
             $displayData['bCusVerification'] = $bCusVerification = $this->bSetVerificationFields($cprog->strE_VerificationModule, $cprog->strE_VModEntryPoint, $strVerificationModule, $strEntryPoint);
         } else {
             $this->cprograms->loadBaseARecViaARecID($cprog, $lRecID, $utable->lNumARecs, $utable->arecs);
             $this->cprograms->loadBaseERecViaERecID($cprog, $lEnrollRecID, $lNumERecs, $erecs);
             $erec =& $erecs[0];
             $displayData['bCusVerification'] = $bCusVerification = $this->bSetVerificationFields($cprog->strA_VerificationModule, $cprog->strA_VModEntryPoint, $strVerificationModule, $strEntryPoint);
             // the Kennetta transformation
             if (CB_AAYHF) {
                 $strCProgName = $cprog->strProgramName;
                 if (strtoupper(substr($strCProgName, 0, 15)) == 'SHIFT ASCENSION') {
                     $utable->bHideDuration = true;
                 }
             }
         }
         $utable->strTableLabel = ($bEnrollment ? $cprog->strSafeEnrollLabel : $cprog->strSafeAttendLabel) . ' record: ' . htmlspecialchars($cprog->strProgramName);
         if (!$bEnrollment) {
             $utable->strTableLabel .= '<br><span style="font-size: 9pt;">' . '&nbsp;(Enrollment: ' . date($genumDateFormat, $erec->dteStart) . ' - ' . (is_null($erec->dteMysqlEnd) ? 'ongoing' : date($genumDateFormat, $erec->dteEnd)) . ')</span>';
         }
     } else {
         $utable->strTableLabel = htmlspecialchars($utable->strUserTableName);
         /* -------------------------------------
         echo('<font class="debug">'.substr(__FILE__, strrpos(__FILE__, '\\'))
            .': '.__LINE__.'<br>$utable   <pre>');
         echo(htmlspecialchars( print_r($utable, true))); echo('</pre></font><br>');
         die;
         // ------------------------------------- */
         $displayData['bCusVerification'] = $bCusVerification = $this->bSetVerificationFields($utable->strVerificationModule, $utable->strVModEntryPoint, $strVerificationModule, $strEntryPoint);
     }
     //-------------------------
     // validation rules
     //-------------------------
     $this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
     if ($bCusVerification) {
         $this->load->helper('path');
         $this->form_validation->set_rules('hVerify', 'Hidden verification', 'required|callback_hiddenVerify[' . $strVerificationModule . ',' . $strEntryPoint . ']');
     }
     // hidden value to force submission
     $this->form_validation->set_rules('hidForceSubmit', 'force', 'trim');
     if ($bCProg) {
         if ($bEnrollment) {
             $this->form_validation->set_rules('chkEnrolled', 'Enrolled', 'trim');
             $this->form_validation->set_rules('txtEStart', 'Enrollment Starting Date', 'trim|required' . '|callback_verifyCProgEStartDate');
             $this->form_validation->set_rules('txtEEnd', 'Enrollment Ending Date', 'callback_verifyCProgEEndDate');
         } else {
             $this->form_validation->set_rules('txtADate', 'Attendance Date', 'trim|required|callback_verifyADate');
             $this->form_validation->set_rules('txtCaseNotes', 'Case Notes', 'trim');
             if (!$utable->bHideDuration) {
                 $this->form_validation->set_rules('ddlDuration', 'Duration', 'trim|required|callback_verifyADuration');
             }
         }
     }
     loadSupportModels($enumTType, $lFID);
     if ($lNumEditableFields > 0) {
         // || $bCProg){
         $utable->ufields =& $this->clsUFD->fields;
         // load single data record
         $this->clsUFD->loadMRRecsViaRID($lRecID);
         $displayData['lNumMRRecs'] = $this->clsUFD->lNumMRRecs;
         $displayData['mRec'] = $mRec =& $this->clsUFD->mrRecs[0];
         // do we need to pre-fill certain fields from a recent record?
         if ($bNew && $bAnyPrefill) {
             $lPrevRecID = $this->clsUFD->lMostRecentRecID_ViaTID_FID($lTableID, $lFID);
             if (!is_null($lPrevRecID)) {
                 $this->prefillRec($lTableID, $mRec, $lPrevRecID, $this->clsUFD->lNumFields, $this->clsUFD->fields);
             }
         }
         $this->setValidationUMTables($displayData['js'], $utable, $bNew, $mRec);
     }
     if ($this->form_validation->run() == FALSE) {
         $displayData['formData'] = new stdClass();
         $this->load->library('generic_form');
         $this->initUTableDates($displayData['js'], $utable, $bNew, $mRec);
         $this->initUTableDDLs($utable);
         // first time displayed, no user data entry errors
         if (validation_errors() == '') {
             if ($bCProg) {
                 if ($bEnrollment) {
                     $this->initCProgE($bNew, $displayData, $utable);
                 } else {
                     $this->initCProgA($bNew, $displayData, $utable);
                 }
             }
             // personalized tables
             $this->setUTableDDLs($utable, $bNew, $mRec);
         } else {
             setOnFormError($displayData);
             if ($bCProg) {
                 if ($bEnrollment) {
                     $this->reloadCProgE($utable);
                 } else {
                     $this->reloadCProgA($utable);
                 }
             }
             // personalized tables
             $this->repopulateMultiTable($utable);
         }
         //--------------------------
         // breadcrumbs
         //--------------------------
         $this->clsUFD->tableContext(0);
         $this->clsUFD->tableContextRecView(0);
         $displayData['strHTMLSummary'] = $this->clsUFD->strHTMLSummary;
         $displayData['errMessages'] = arrayCopy($gErrMessages);
         $displayData['pageTitle'] = $this->clsUFD->strBreadcrumbsTableDisplay(0);
         $displayData['title'] = CS_PROGNAME . ' | Personalized Tables';
         $displayData['nav'] = $this->mnav_brain_jar->navData();
         $displayData['mainTemplate'] = 'personalization/uf_multi_rec_add_edit_view';
         $this->load->vars($displayData);
         $this->load->view('template');
     } else {
         $lRecID = $this->clsUFD->lSaveMultiRecViaPost($bNew, $lFID, $lRecID, $utable);
         $this->session->set_flashdata('msg', 'A record was ' . ($bNew ? 'added' : 'updated') . ' in table <b>' . $utable->strTableLabel . '</b>');
         //            // flashdata got hosed... using session instead;
         //            // also - the unset on session variables is not working....
         //         if (isset($_SESSION[CS_NAMESPACE.'rpAttendanceAddEdit']) &&
         //             $_SESSION[CS_NAMESPACE.'rpAttendanceAddEdit'] != ''){
         //            $strReturnPath = $_SESSION[CS_NAMESPACE.'rpAttendanceAddEdit'];
         //            $_SESSION[CS_NAMESPACE.'rpAttendanceAddEdit'] = '';
         //            unset($GLOBALS[_SESSION][CS_NAMESPACE.'rpAttendanceAddEdit']);
         ////            unset($_SESSION[CS_NAMESPACE.'rpAttendanceAddEdit']);
         // if a custom return path is requested, and if the associated session
         // variable return path is set, return to that location
         if ($bUseReturnPath && isset($_SESSION[CS_NAMESPACE . 'rpAttendanceAddEdit']) && $_SESSION[CS_NAMESPACE . 'rpAttendanceAddEdit'] != '') {
             redirect($_SESSION[CS_NAMESPACE . 'rpAttendanceAddEdit']);
         } elseif ($bUseReturnPath && isset($_SESSION[CS_NAMESPACE . 'rpEnrollAddEdit']) && $_SESSION[CS_NAMESPACE . 'rpEnrollAddEdit'] != '') {
             redirect($_SESSION[CS_NAMESPACE . 'rpEnrollAddEdit']);
         } else {
             if ($bNew && $bCProg && $bEnrollment) {
                 redirect('cprograms/enroll_attend_add_edit/qAddAttend/' . $lCProgID . '/' . $lTableID . '/' . $lFID . '/' . $lRecID);
             } else {
                 redirect('admin/uf_multirecord_view/viewMRViaFID/' . $lTableID . '/' . $lFID . '/' . $lEnrollRecID);
             }
         }
     }
 }
コード例 #8
0
 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');
 }
コード例 #9
0
 function userAddEdit($lTableID, $lForeignID, $lEditFieldID)
 {
     //-----------------------------------------------------------------------------
     //
     //-----------------------------------------------------------------------------
     global $gbDateFormatUS;
     $this->load->helper('dl_util/verify_id');
     if (!vid_bUserTableIDExists($this, $lTableID, $enumTabType)) {
         vid_bTestFail($this, false, 'user table ID', $lTableID);
     }
     verifyIDsViaType($this, $enumTabType, $lForeignID, false);
     if (!is_numeric($lEditFieldID)) {
         vid_bTestFail($this, false, 'user field ID', $lEditFieldID);
     }
     $displayData = array();
     $displayData['lTableID'] = $lTableID = (int) $lTableID;
     $displayData['lForeignID'] = $lForeignID = (int) $lForeignID;
     $displayData['lEditFieldID'] = $lEditFieldID = (int) $lEditFieldID;
     //-----------------------
     // load table info
     //-----------------------
     $bEditMode = $lEditFieldID > 0;
     $this->load->model('personalization/muser_fields', 'clsUF');
     $this->load->model('personalization/muser_fields_display', 'clsUFD');
     $this->load->model('admin/mpermissions', 'perms');
     $this->load->library('util/dl_date_time', '', 'clsDateTime');
     $params = array('enumStyle' => 'enpRptC');
     $this->load->library('generic_rpt', $params);
     $this->load->model('admin/madmin_aco');
     $this->load->helper('dl_util/time_date');
     $this->load->helper('dl_util/context');
     $this->clsUFD->lTableID = $lTableID;
     $this->clsUFD->lForeignID = $lForeignID;
     $this->clsUFD->loadTableViaTableID();
     $enumTType = $this->clsUFD->userTables[0]->enumTType;
     loadSupportModels($enumTType, $lForeignID);
     // validation rules
     $this->form_validation->set_error_delimiters('<div class="formError">', '</div>');
     $this->form_validation->set_rules('txtxxxx');
     // dummy
     if ($bEditMode) {
         $this->clsUFD->loadSingleField($lEditFieldID);
         $enumFType = $this->clsUFD->fields[0]->enumFieldType;
         $strFName = 'var' . $lEditFieldID;
         if ($enumFType == CS_FT_DATE) {
             $this->form_validation->set_rules($strFName, 'Date Field', 'trim|callback_ufFieldVerifyDateValid');
         }
         if ($enumFType == CS_FT_INTEGER) {
             $this->form_validation->set_rules($strFName, 'Number Field', 'trim|required|callback_stripCommas|integer');
         }
         if ($enumFType == CS_FT_CURRENCY) {
             $this->form_validation->set_rules($strFName, 'Currency Field', 'trim|required|callback_stripCommas|numeric');
         }
     }
     if ($this->form_validation->run() == FALSE) {
         //------------------------------------------------------
         // set form validation based on field type being edited
         //------------------------------------------------------
         if ($bEditMode) {
             $this->load->helper('dl_util/web_layout');
         }
         $displayData['title'] = CS_PROGNAME . ' | Personalized Fields';
         $displayData['pageTitle'] = $this->clsUFD->strBreadcrumbsTableDisplay(0);
         $displayData['nav'] = $this->mnav_brain_jar->navData();
         $displayData['strTableDisplay'] = $this->clsUFD->strEditUserTableEntries($lEditFieldID);
         $displayData['strHTMLSummary'] = $this->clsUFD->strHTMLSummary;
         $displayData['mainTemplate'] = 'admin/user_table_add_edit_view';
         $this->load->vars($displayData);
         $this->load->view('template');
     } else {
         $this->clsUFD->loadSingleField($lEditFieldID);
         $enumType = $this->clsUFD->fields[0]->enumFieldType;
         $strFieldID = 'var' . $lEditFieldID;
         switch ($enumType) {
             case CS_FT_CHECKBOX:
                 $varUserVal = @$_POST[$strFieldID] == 'TRUE';
                 break;
             case CS_FT_DATE:
                 $varUserVal = trim($_POST[$strFieldID]);
                 if ($varUserVal == '') {
                     $varUserVal = ' null ';
                 } else {
                     MDY_ViaUserForm($varUserVal, $lMon, $lDay, $lYear, $gbDateFormatUS);
                     $varUserVal = ' "' . strMoDaYr2MySQLDate($lMon, $lDay, $lYear) . '" ';
                 }
                 break;
             case CS_FT_DATETIME:
                 break;
             case CS_FT_TEXTLONG:
             case CS_FT_TEXT255:
             case CS_FT_TEXT80:
             case CS_FT_TEXT20:
                 $varUserVal = trim($_POST[$strFieldID]);
                 break;
             case CS_FT_INTEGER:
                 $varUserVal = (int) $_POST[$strFieldID];
                 break;
             case CS_FT_CURRENCY:
                 $varUserVal = number_format($_POST[$strFieldID], 2, '.', '');
                 break;
             case CS_FT_DDL:
                 $varUserVal = (int) $_POST[$strFieldID];
                 break;
             default:
                 screamForHelp($enumType . ': invalid field type<br>error on line ' . __LINE__ . ',<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__);
                 break;
         }
         $this->clsUFD->updateUserField($varUserVal);
         redirect('admin/uf_user_edit/userAddEdit/' . $lTableID . '/' . $lForeignID . '/0');
     }
 }