當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Draft::remove方法代碼示例

本文整理匯總了PHP中Draft::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP Draft::remove方法的具體用法?PHP Draft::remove怎麽用?PHP Draft::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Draft的用法示例。


在下文中一共展示了Draft::remove方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: send

 /**
  * Converts an email to a draft and sends it.
  *
  * @access  public
  * @param   integer $draft_id The id of the draft to send.
  */
 function send($draft_id)
 {
     global $HTTP_POST_VARS;
     $draft_id = Misc::escapeInteger($draft_id);
     $draft = Draft::getDetails($draft_id);
     $HTTP_POST_VARS["issue_id"] = $draft["emd_iss_id"];
     $HTTP_POST_VARS["subject"] = $draft["emd_subject"];
     $HTTP_POST_VARS["from"] = User::getFromHeader(Auth::getUserID());
     $HTTP_POST_VARS["to"] = $draft["to"];
     $HTTP_POST_VARS["cc"] = @join(";", $draft["cc"]);
     $HTTP_POST_VARS["message"] = $draft["emd_body"];
     $HTTP_POST_VARS["ema_id"] = Email_Account::getEmailAccount();
     $res = Support::sendEmail();
     if ($res == 1) {
         Draft::remove($draft_id);
     }
     return $res;
 }
開發者ID:juliogallardo1326,項目名稱:proc,代碼行數:24,代碼來源:class.draft.php

示例2: array

if ($issue_id) {
    $_POST['to'] = '';
}
if ($cat == 'send_email') {
    $res = Support::sendEmailFromPost($_POST['parent_id']);
    $tpl->assign('send_result', $res);
    if (Access::canChangeStatus($issue_id, $usr_id) && isset($_POST['new_status']) && !empty($_POST['new_status'])) {
        $res = Issue::setStatus($issue_id, $_POST['new_status']);
        if ($res != -1) {
            $new_status = Status::getStatusTitle($_POST['new_status']);
            History::add($issue_id, $usr_id, 'status_changed', "Status changed to '{status}' by {user} when sending an email", array('status' => $new_status, 'user' => User::getFullName($usr_id)));
        }
    }
    // remove the existing email draft, if appropriate
    if (!empty($_POST['draft_id'])) {
        Draft::remove($_POST['draft_id']);
    }
    // enter the time tracking entry about this new email
    if (!empty($_POST['time_spent'])) {
        $date = (array) $_POST['date'];
        $ttc_id = Time_Tracking::getCategoryId($prj_id, 'Email Discussion');
        $time_spent = (int) $_POST['time_spent'];
        $summary = 'Time entry inserted when sending outgoing email.';
        Time_Tracking::addTimeEntry($issue_id, $ttc_id, $time_spent, $date, $summary);
    }
} elseif ($cat == 'save_draft') {
    $res = Draft::saveEmail($issue_id, $_POST['to'], $_POST['cc'], $_POST['subject'], $_POST['message'], $_POST['parent_id']);
    $tpl->assign('draft_result', $res);
} elseif ($cat == 'update_draft') {
    $res = Draft::update($issue_id, $_POST['draft_id'], $_POST['to'], $_POST['cc'], $_POST['subject'], $_POST['message'], $_POST['parent_id']);
    $tpl->assign('draft_result', $res);
開發者ID:korusdipl,項目名稱:eventum,代碼行數:31,代碼來源:send.php

示例3: elseif

    $HTTP_POST_VARS['to'] = '';
}
if (@$HTTP_POST_VARS["cat"] == "send_email") {
    $res = Support::sendEmail($HTTP_POST_VARS['parent_id']);
    $tpl->assign("send_result", $res);
    if (!@empty($HTTP_POST_VARS['new_status'])) {
        $res = Issue::setStatus($issue_id, $HTTP_POST_VARS['new_status']);
        Issue::updateControlStatus($issue_id);
        if ($res != -1) {
            $new_status = Status::getStatusTitle($HTTP_POST_VARS['new_status']);
            History::add($issue_id, $usr_id, History::getTypeID('status_changed'), "Status changed to '{$new_status}' by " . User::getFullName($usr_id) . " when sending an email");
        }
    }
    // remove the existing email draft, if appropriate
    if (!empty($HTTP_POST_VARS['draft_id'])) {
        Draft::remove($HTTP_POST_VARS['draft_id']);
    }
    // enter the time tracking entry about this new email
    if (!empty($HTTP_POST_VARS['time_spent'])) {
        $HTTP_POST_VARS['issue_id'] = $issue_id;
        $HTTP_POST_VARS['category'] = Time_Tracking::getCategoryID('Email Discussion');
        $HTTP_POST_VARS['summary'] = 'Time entry inserted when sending outgoing email.';
        Time_Tracking::insertEntry();
    }
} elseif (@$HTTP_POST_VARS["cat"] == "save_draft") {
    $res = Draft::saveEmail($issue_id, $HTTP_POST_VARS["to"], $HTTP_POST_VARS["cc"], $HTTP_POST_VARS["subject"], $HTTP_POST_VARS["message"], $HTTP_POST_VARS["parent_id"]);
    $tpl->assign("draft_result", $res);
} elseif (@$HTTP_POST_VARS["cat"] == "update_draft") {
    $res = Draft::update($issue_id, $HTTP_POST_VARS["draft_id"], $HTTP_POST_VARS["to"], $HTTP_POST_VARS["cc"], $HTTP_POST_VARS["subject"], $HTTP_POST_VARS["message"], $HTTP_POST_VARS["parent_id"]);
    $tpl->assign("draft_result", $res);
} elseif (Auth::getCurrentRole() >= User::getRoleID('Developer')) {
開發者ID:juliogallardo1326,項目名稱:proc,代碼行數:31,代碼來源:send.php


注:本文中的Draft::remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。