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


PHP Issue::close方法代码示例

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


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

示例1: closeIssue

 /**
  * @param int $issue_id
  * @param string $new_status
  * @param int $resolution_id
  * @param bool $send_notification
  * @param string $note
  * @return string
  * @access protected
  */
 public function closeIssue($issue_id, $new_status, $resolution_id, $send_notification, $note)
 {
     $usr_id = Auth::getUserID();
     $status_id = Status::getStatusID($new_status);
     AuthCookie::setProjectCookie(Issue::getProjectID($issue_id));
     $res = Issue::close($usr_id, $issue_id, $send_notification, $resolution_id, $status_id, $note);
     if ($res == -1) {
         throw new RemoteApiException("Could not close issue #{$issue_id}");
     }
     $prj_id = Issue::getProjectID($issue_id);
     if (CRM::hasCustomerIntegration($prj_id)) {
         $crm = CRM::getInstance($prj_id);
         try {
             $contract = $crm->getContract(Issue::getContractID($issue_id));
             if ($contract->hasPerIncident()) {
                 return 'INCIDENT';
             }
         } catch (CRMException $e) {
         }
     }
     return 'OK';
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:31,代码来源:RemoteApi.php

示例2: elseif

    $tpl->displayTemplate();
    exit;
} elseif ($role_id == User::getRoleID('customer') || !Issue::canAccess($issue_id, $usr_id)) {
    $tpl->assign('auth_customer', 'denied');
    $tpl->displayTemplate();
    exit;
}
$details = Issue::getDetails($issue_id);
$notification_list = Notification::getSubscribers($issue_id, 'closed');
$tpl->assign('notification_list_all', $notification_list['all']);
$notification_list_internal = Notification::getSubscribers($issue_id, 'closed', User::getRoleID('Standard User'));
$tpl->assign('notification_list_internal', $notification_list_internal['all']);
$cat = isset($_REQUEST['cat']) ? (string) $_REQUEST['cat'] : null;
if ($cat == 'close') {
    Custom_Field::updateValues();
    $res = Issue::close(Auth::getUserID(), $issue_id, $_REQUEST['send_notification'], $_REQUEST['resolution'], $_REQUEST['status'], $_REQUEST['reason'], @$_REQUEST['notification_list']);
    if (!empty($_POST['time_spent'])) {
        $date = (array) $_POST['date'];
        $ttc_id = (int) $_POST['category'];
        $iss_id = (int) $_POST['issue_id'];
        $time_spent = (int) $_POST['time_spent'];
        $summary = 'Time entry inserted when closing issue.';
        Time_Tracking::addTimeEntry($iss_id, $ttc_id, $time_spent, $date, $summary);
    }
    if (CRM::hasCustomerIntegration($prj_id) && isset($details['contract'])) {
        $crm = CRM::getInstance($prj_id);
        $contract = $details['contract'];
        if ($contract->hasPerIncident()) {
            $contract->updateRedeemedIncidents($issue_id, @$_REQUEST['redeem']);
        }
    }
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:close.php

示例3: closeIssue

function closeIssue($p)
{
    $email = XML_RPC_decode($p->getParam(0));
    $password = XML_RPC_decode($p->getParam(1));
    $auth = authenticate($email, $password);
    if (is_object($auth)) {
        return $auth;
    }
    $usr_id = User::getUserIDByEmail($email);
    $issue_id = XML_RPC_decode($p->getParam(2));
    $new_status = XML_RPC_decode($p->getParam(3));
    $status_id = Status::getStatusID($new_status);
    $resolution_id = XML_RPC_decode($p->getParam(4));
    $send_notification = XML_RPC_decode($p->getParam(5));
    $note = XML_RPC_decode($p->getParam(6));
    createFakeCookie($email, Issue::getProjectID($issue_id));
    $res = Issue::close($usr_id, $issue_id, $send_notification, $resolution_id, $status_id, $note);
    if ($res == -1) {
        return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "Could not close issue #{$issue_id}");
    } else {
        $prj_id = Issue::getProjectID($issue_id);
        if (Customer::hasCustomerIntegration($prj_id) && Customer::hasPerIncidentContract($prj_id, Issue::getCustomerID($issue_id))) {
            return new XML_RPC_Response(XML_RPC_Encode('INCIDENT'));
        } else {
            return new XML_RPC_Response(XML_RPC_Encode('OK'));
        }
    }
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:28,代码来源:xmlrpc.php

示例4: Template_API

include_once APP_INC_PATH . "class.time_tracking.php";
include_once APP_INC_PATH . "class.status.php";
include_once APP_INC_PATH . "class.notification.php";
include_once APP_INC_PATH . "db_access.php";
$tpl = new Template_API();
$tpl->setTemplate("close.tpl.html");
Auth::checkAuthentication(APP_COOKIE);
$prj_id = Auth::getCurrentProject();
$issue_id = @$HTTP_POST_VARS["issue_id"] ? $HTTP_POST_VARS["issue_id"] : $HTTP_GET_VARS["id"];
$tpl->assign("extra_title", "Close Issue #{$issue_id}");
$notification_list = Notification::getSubscribers($issue_id, 'closed');
$tpl->assign("notification_list_all", $notification_list['all']);
$notification_list_internal = Notification::getSubscribers($issue_id, 'closed', User::getRoleID("standard User"));
$tpl->assign("notification_list_internal", $notification_list_internal['all']);
if (@$HTTP_POST_VARS["cat"] == "close") {
    $res = Issue::close(Auth::getUserID(), $HTTP_POST_VARS["issue_id"], $HTTP_POST_VARS["send_notification"], $HTTP_POST_VARS["resolution"], $HTTP_POST_VARS["status"], $HTTP_POST_VARS["reason"], @$_REQUEST['notification_list']);
    if (!empty($HTTP_POST_VARS['time_spent'])) {
        $HTTP_POST_VARS['summary'] = 'Time entry inserted when closing issue.';
        Time_Tracking::insertEntry();
    }
    if (Customer::hasCustomerIntegration($prj_id) && Customer::hasPerIncidentContract($prj_id, Issue::getCustomerID($issue_id))) {
        Customer::updateRedeemedIncidents($prj_id, $issue_id, @$_REQUEST['redeem']);
    }
    $tpl->assign("close_result", $res);
}
$tpl->assign("statuses", Status::getClosedAssocList($prj_id));
$tpl->assign("resolutions", Resolution::getAssocList());
$tpl->assign("time_categories", Time_Tracking::getAssocCategories());
if (Customer::hasCustomerIntegration($prj_id) && Customer::hasPerIncidentContract($prj_id, Issue::getCustomerID($issue_id))) {
    $details = Issue::getDetails($issue_id);
    $tpl->assign(array('redeemed' => Customer::getRedeemedIncidentDetails($prj_id, $issue_id), 'incident_details' => $details['customer_info']['incident_details']));
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:close.php


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