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


PHP History::storeHistoryData方法代码示例

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


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

示例1: setStatus

 public function setStatus($candidateID, $jobOrderID, $statusID, $emailAddress, $emailText)
 {
     /* Get existing status. */
     $sql = sprintf("SELECT\n                status AS oldStatusID,\n                candidate_joborder_id AS candidateJobOrderID\n            FROM\n                candidate_joborder\n            WHERE\n                joborder_id = %s\n            AND\n                candidate_id = %s\n            AND\n                site_id = %s", $this->_db->makeQueryInteger($jobOrderID), $this->_db->makeQueryInteger($candidateID), $this->_siteID);
     $rs = $this->_db->getAssoc($sql);
     if (empty($rs)) {
         return;
     }
     $candidateJobOrderID = $rs['candidateJobOrderID'];
     $oldStatusID = $rs['oldStatusID'];
     if ($oldStatusID == $statusID) {
         /* No need to update the database and scew the history if there is
          * no actual change.
          */
         return;
     }
     /* Change status. */
     $sql = sprintf("UPDATE\n                candidate_joborder\n            SET\n                status        = %s,\n                date_modified = NOW()\n            WHERE\n                candidate_joborder_id = %s\n            AND\n                site_id = %s", $this->_db->makeQueryInteger($statusID), $this->_db->makeQueryInteger($candidateJobOrderID), $this->_siteID);
     $this->_db->query($sql);
     /* Add history. */
     $historyID = $this->addStatusHistory($candidateID, $jobOrderID, $statusID, $oldStatusID);
     /* Add auditing history. */
     $historyDescription = '(USER) changed pipeline status of candidate ' . $candidateID . ' for job order ' . $jobOrderID . '.';
     $history = new History($this->_siteID);
     $history->storeHistoryData(DATA_ITEM_PIPELINE, $candidateJobOrderID, 'PIPELINE', $oldStatusID, $statusID, $historyDescription);
     if (!empty($emailAddress)) {
         /* Send e-mail notification. */
         //FIXME: Make subject configurable.
         $mailer = new Mailer($this->_siteID);
         $mailerStatus = $mailer->sendToOne(array("id" => $candidateID, "email" => array($emailAddress)), CANDIDATE_STATUSCHANGE_SUBJECT, $emailText, true);
     }
 }
开发者ID:Hassanj343,项目名称:candidats,代码行数:32,代码来源:Pipelines.php

示例2: delete

 /**
  * Removes an activity note from the system.
  *
  * @param integer Activity ID.
  * @return boolean True if successful; false otherwise.
  */
 public function delete($activityID)
 {
     $sql = sprintf("SELECT\n                activity.data_item_id AS dataItemID,\n                activity.data_item_type AS dataItemType,\n                activity.joborder_id AS jobOrderID,\n                activity.notes AS notes,\n                activity.entered_by AS enteredBy,\n                CONCAT(\n                    user.first_name, ' ', user.last_name\n                ) AS enteredByFullName\n            FROM\n                activity\n            LEFT JOIN user AS user\n                ON activity.entered_by = user.user_id\n            WHERE\n                activity.activity_id = %s\n            AND\n                activity.site_id = %s", $this->_db->makeQueryInteger($activityID), $this->_siteID);
     $activityIDRS = $this->_db->getAssoc($sql);
     if (!$activityIDRS) {
         return false;
     }
     $sql = sprintf("DELETE FROM\n                activity\n            WHERE\n                activity_id = %s\n            AND\n                site_id = %s", $this->_db->makeQueryInteger($activityID), $this->_siteID);
     $queryResult = $this->_db->query($sql);
     if (!$queryResult) {
         return false;
     }
     $history = new History($this->_siteID);
     $history->storeHistoryData($activityIDRS['dataItemType'], $activityIDRS['dataItemID'], 'ACTIVITY', $activityIDRS['notes'], '(DELETE)', '(USER) Deleted ' . $activityIDRS['enteredByFullName'] . '\'s activity.');
     /* Update the last-modified timestamp for the "parent" Data Item. */
     $this->_updateDataItemModified($activityIDRS['dataItemID'], $activityIDRS['dataItemType']);
     /* If there is a job order associated, update it's modified timestamp,
      * too.
      */
     if (!empty($activityIDRS['jobOrderID']) && ctype_digit((string) $activityIDRS['jobOrderID'])) {
         $this->_updateDataItemModified($activityIDRS['jobOrderID'], DATA_ITEM_JOBORDER);
     }
     return true;
 }
开发者ID:Hassanj343,项目名称:candidats,代码行数:30,代码来源:Shedules.php


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