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


PHP Attachments::copyAttachment方法代码示例

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


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

示例1: merge


//.........这里部分代码省略.........
            $isHot,
            $email,
            $emailAddress,
            $gender,
            $race,
            $veteran,
            $disability
        );
        if (!$updateSuccess)
        {
            CommonErrors::fatal(COMMONERROR_RECORDERROR, $this, 'Failed to update candidate.');
        }

        /* Update extra fields. */
        $candidates->extraFields->setValuesOnEdit($candidateID);

        /* Update possible source list */
        $sources = $candidates->getPossibleSources();
        $sourcesDifferences = ListEditor::getDifferencesFromList(
            $sources, 'name', 'sourceID', $sourceCSV
        );

        $candidates->updatePossibleSources($sourcesDifferences);

        
        //else
        //{
            /* 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);
                $newAttachmentID=$attachments->copyAttachment(DATA_ITEM_CANDIDATE, $candidateID, $attachmentID);
                //trace($newAttachmentID);
                //$attachments->setDataItemID($newAttachmentID, $candidateID, DATA_ITEM_CANDIDATE);
            }

            /* Attach a resume if the user uploaded one. (http POST) */
            /* NOTE: This function cannot be called if parsing is enabled */
            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();
开发者ID:Hassanj343,项目名称:candidats,代码行数:66,代码来源:CandidatesUI.php


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