当前位置: 首页>>代码示例>>PHP>>正文


PHP Attachments::setDataItemID方法代码示例

本文整理汇总了PHP中Attachments::setDataItemID方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachments::setDataItemID方法的具体用法?PHP Attachments::setDataItemID怎么用?PHP Attachments::setDataItemID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attachments的用法示例。


在下文中一共展示了Attachments::setDataItemID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _addCandidate


//.........这里部分代码省略.........
     $gender = $this->getTrimmedInput('gender', $_POST);
     $race = $this->getTrimmedInput('race', $_POST);
     $veteran = $this->getTrimmedInput('veteran', $_POST);
     $disability = $this->getTrimmedInput('disability', $_POST);
     /* Candidate source list editor. */
     $sourceCSV = $this->getTrimmedInput('sourceCSV', $_POST);
     /* Text resume. */
     $textResumeBlock = $this->getTrimmedInput('textResumeBlock', $_POST);
     $textResumeFilename = $this->getTrimmedInput('textResumeFilename', $_POST);
     /* File resume. */
     $associatedFileResumeID = $this->getTrimmedInput('associatedbFileResumeID', $_POST);
     /* Bail out if any of the required fields are empty. */
     if (empty($firstName) || empty($lastName)) {
         CommonErrors::fatal(COMMONERROR_MISSINGFIELDS, $this);
     }
     if (!eval(Hooks::get('CANDIDATE_ON_ADD_PRE'))) {
         return;
     }
     $candidates = new Candidates($this->_siteID);
     $candidateID = $candidates->add($firstName, $middleName, $lastName, $email1, $email2, $phoneHome, $phoneCell, $phoneWork, $address, $city, $state, $zip, $source, $keySkills, $dateAvailable, $currentEmployer, $canRelocate, $currentPay, $desiredPay, $notes, $webSite, $bestTimeToCall, $this->_userID, $this->_userID, $gender, $race, $veteran, $disability);
     if ($candidateID <= 0) {
         return $candidateID;
     }
     /* Update extra fields. */
     $candidates->extraFields->setValuesOnEdit($candidateID);
     /* Update possible source list. */
     $sources = $candidates->getPossibleSources();
     $sourcesDifferences = ListEditor::getDifferencesFromList($sources, 'name', 'sourceID', $sourceCSV);
     $candidates->updatePossibleSources($sourcesDifferences);
     /* Associate an exsisting resume if the user created a candidate with one. (Bulk) */
     if (isset($_POST['associatedAttachment'])) {
         $attachmentID = $_POST['associatedAttachment'];
         $attachments = new Attachments($this->_siteID);
         $attachments->setDataItemID($attachmentID, $candidateID, DATA_ITEM_CANDIDATE);
     } else {
         if (isset($_FILES['file']) && !empty($_FILES['file']['name'])) {
             if (!eval(Hooks::get('CANDIDATE_ON_CREATE_ATTACHMENT_PRE'))) {
                 return;
             }
             $attachmentCreator = new AttachmentCreator($this->_siteID);
             $attachmentCreator->createFromUpload(DATA_ITEM_CANDIDATE, $candidateID, 'file', false, true);
             if ($attachmentCreator->isError()) {
                 CommonErrors::fatal(COMMONERROR_FILEERROR, $this, $attachmentCreator->getError());
             }
             if ($attachmentCreator->duplicatesOccurred()) {
                 $this->listByView('This attachment has already been added to this candidate.');
                 return;
             }
             $isTextExtractionError = $attachmentCreator->isTextExtractionError();
             $textExtractionErrorMessage = $attachmentCreator->getTextExtractionError();
             // FIXME: Show parse errors!
             if (!eval(Hooks::get('CANDIDATE_ON_CREATE_ATTACHMENT_POST'))) {
                 return;
             }
         } else {
             if (LicenseUtility::isParsingEnabled()) {
                 /**
                  * Description: User clicks "browse" and selects a resume file. User doesn't click
                  * upload. The resume file is STILL uploaded.
                  * Controversial: User uploads a resume, parses, etc. User selects a new file with
                  * "Browse" but doesn't click "Upload". New file is accepted.
                  * It's technically correct either way, I'm opting for the "use whats in "file"
                  * box over what's already uploaded method to avoid losing resumes on candidate
                  * additions.
                  */
                 $newFile = FileUtility::getUploadFileFromPost($this->_siteID, 'addcandidate', 'documentFile');
开发者ID:PublicityPort,项目名称:OpenCATS,代码行数:67,代码来源:CandidatesUI.php


注:本文中的Attachments::setDataItemID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。