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


PHP Attachments::forceAttachmentLocal方法代码示例

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


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

示例1: show

 private function show()
 {
     /* Is this a popup? */
     if (isset($_GET['display']) && $_GET['display'] == 'popup') {
         $isPopup = true;
     } else {
         $isPopup = false;
     }
     /* Bail out if we don't have a valid candidate ID. */
     if (!$this->isRequiredIDValid('candidateID', $_GET) && !isset($_GET['email'])) {
         CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.');
     }
     $candidates = new Candidates($this->_siteID);
     if (isset($_GET['candidateID'])) {
         $candidateID = $_GET['candidateID'];
     } else {
         $candidateID = $candidates->getIDByEmail($_GET['email']);
     }
     $data = $candidates->get($candidateID);
     /* Bail out if we got an empty result set. */
     if (empty($data)) {
         CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'The specified candidate ID could not be found.');
         return;
     }
     if ($data['isAdminHidden'] == 1 && $this->_accessLevel < ACCESS_LEVEL_MULTI_SA) {
         $this->listByView('This candidate is hidden - only a CATS Administrator can unlock the candidate.');
         return;
     }
     /* We want to handle formatting the city and state here instead
      * of in the template.
      */
     $data['cityAndState'] = StringUtility::makeCityStateString($data['city'], $data['state']);
     /*
      * Replace newlines with <br />, fix HTML "special" characters, and
      * strip leading empty lines and spaces.
      */
     $data['notes'] = trim(nl2br(htmlspecialchars($data['notes'], ENT_QUOTES)));
     /* Chop $data['notes'] to make $data['shortNotes']. */
     if (strlen($data['notes']) > self::NOTES_MAXLEN) {
         $data['shortNotes'] = substr($data['notes'], 0, self::NOTES_MAXLEN);
         $isShortNotes = true;
     } else {
         $data['shortNotes'] = $data['notes'];
         $isShortNotes = false;
     }
     /* Format "can relocate" status. */
     if ($data['canRelocate'] == 1) {
         $data['canRelocate'] = 'Yes';
     } else {
         $data['canRelocate'] = 'No';
     }
     if ($data['isHot'] == 1) {
         $data['titleClass'] = 'jobTitleHot';
     } else {
         $data['titleClass'] = 'jobTitleCold';
     }
     $attachments = new Attachments($this->_siteID);
     $attachmentsRS = $attachments->getAll(DATA_ITEM_CANDIDATE, $candidateID);
     foreach ($attachmentsRS as $rowNumber => $attachmentsData) {
         /* If profile image is not local, force it to be local. */
         if ($attachmentsData['isProfileImage'] == 1) {
             $attachments->forceAttachmentLocal($attachmentsData['attachmentID']);
         }
         /* Show an attachment icon based on the document's file type. */
         $attachmentIcon = strtolower(FileUtility::getAttachmentIcon($attachmentsRS[$rowNumber]['originalFilename']));
         $attachmentsRS[$rowNumber]['attachmentIcon'] = $attachmentIcon;
         /* If the text field has any text, show a preview icon. */
         if ($attachmentsRS[$rowNumber]['hasText']) {
             $attachmentsRS[$rowNumber]['previewLink'] = sprintf('<a href="#" onclick="window.open(\'%s?m=candidates&amp;a=viewResume&amp;attachmentID=%s\', \'viewResume\', \'scrollbars=1,width=800,height=760\')"><img width="15" height="15" style="border: none;" src="images/search.gif" alt="(Preview)" /></a>', CATSUtility::getIndexName(), $attachmentsRS[$rowNumber]['attachmentID']);
         } else {
             $attachmentsRS[$rowNumber]['previewLink'] = '&nbsp;';
         }
     }
     $pipelines = new Pipelines($this->_siteID);
     $pipelinesRS = $pipelines->getCandidatePipeline($candidateID);
     $sessionCookie = $_SESSION['CATS']->getCookie();
     /* Format pipeline data. */
     foreach ($pipelinesRS as $rowIndex => $row) {
         /* Hot jobs [can] have different title styles than normal
          * jobs.
          */
         if ($row['isHot'] == 1) {
             $pipelinesRS[$rowIndex]['linkClass'] = 'jobLinkHot';
         } else {
             $pipelinesRS[$rowIndex]['linkClass'] = 'jobLinkCold';
         }
         $pipelinesRS[$rowIndex]['ownerAbbrName'] = StringUtility::makeInitialName($pipelinesRS[$rowIndex]['ownerFirstName'], $pipelinesRS[$rowIndex]['ownerLastName'], false, LAST_NAME_MAXLEN);
         $pipelinesRS[$rowIndex]['addedByAbbrName'] = StringUtility::makeInitialName($pipelinesRS[$rowIndex]['addedByFirstName'], $pipelinesRS[$rowIndex]['addedByLastName'], false, LAST_NAME_MAXLEN);
         $pipelinesRS[$rowIndex]['ratingLine'] = TemplateUtility::getRatingObject($pipelinesRS[$rowIndex]['ratingValue'], $pipelinesRS[$rowIndex]['candidateJobOrderID'], $sessionCookie);
     }
     $activityEntries = new ActivityEntries($this->_siteID);
     $activityRS = $activityEntries->getAllByDataItem($candidateID, DATA_ITEM_CANDIDATE);
     if (!empty($activityRS)) {
         foreach ($activityRS as $rowIndex => $row) {
             if (empty($activityRS[$rowIndex]['notes'])) {
                 $activityRS[$rowIndex]['notes'] = '(No Notes)';
             }
             if (empty($activityRS[$rowIndex]['jobOrderID']) || empty($activityRS[$rowIndex]['regarding'])) {
                 $activityRS[$rowIndex]['regarding'] = 'General';
             }
//.........这里部分代码省略.........
开发者ID:PublicityPort,项目名称:OpenCATS,代码行数:101,代码来源:CandidatesUI.php

示例2: show


//.........这里部分代码省略.........
                $data["ownerFullName"]=$row["groupname"];
            }
        }
        
        /* Format "can relocate" status. */
        if ($data['can_relocate'] == 1)
        {
            $data['can_relocate'] = 'Yes';
        }
        else
        {
            $data['can_relocate'] = 'No';
        }

        if ($data['is_hot'] == 1)
        {
            $data['titleClass'] = 'jobTitleHot';
        }
        else
        {
            $data['titleClass'] = 'jobTitleCold';
        }

        $attachments = new Attachments($this->_siteID);
        $attachmentsRS = $attachments->getAll(
            DATA_ITEM_CANDIDATE, $candidateID
        );

        foreach ($attachmentsRS as $rowNumber => $attachmentsData)
        {
            /* If profile image is not local, force it to be local. */
            if ($attachmentsData['isProfileImage'] == 1)
            {
                $attachments->forceAttachmentLocal($attachmentsData['attachmentID']);
            }

            /* Show an attachment icon based on the document's file type. */
            $attachmentIcon = strtolower(
                FileUtility::getAttachmentIcon(
                    $attachmentsRS[$rowNumber]['originalFilename']
                )
            );

            $attachmentsRS[$rowNumber]['attachmentIcon'] = $attachmentIcon;

            /* If the text field has any text, show a preview icon. */
            if ($attachmentsRS[$rowNumber]['hasText'])
            {
                $attachmentsRS[$rowNumber]['previewLink'] = sprintf(
                    '<a href="#" onclick="window.open(\'%s?m=candidates&amp;a=viewResume&amp;attachmentID=%s\', \'viewResume\', \'scrollbars=1,width=800,height=760\')"><img width="15" height="15" style="border: none;" src="images/search.gif" alt="(Preview)" /></a>',
                    CATSUtility::getIndexName(),
                    $attachmentsRS[$rowNumber]['attachmentID']
                );
            }
            else
            {
                $attachmentsRS[$rowNumber]['previewLink'] = '&nbsp;';
            }
        }
        $pipelines = new Pipelines($this->_siteID);
        $pipelinesRS = $pipelines->getCandidatePipeline($candidateID);

        $sessionCookie = $_SESSION['CATS']->getCookie();

        /* Format pipeline data. */
        foreach ($pipelinesRS as $rowIndex => $row)
开发者ID:Hassanj343,项目名称:candidats,代码行数:67,代码来源:CandidatesUI.php


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