當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。