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


PHP Status::getStatusID方法代码示例

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


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

示例1: setRemoteStatus

 /**
  * Method used to remotely set the status of a given issue.
  *
  * @param   integer $issue_id The issue ID
  * @param   integer $usr_id The user ID of the person performing this change
  * @param   integer $new_status The new status ID
  * @return  integer 1 if the update worked, -1 otherwise
  */
 public static function setRemoteStatus($issue_id, $usr_id, $new_status)
 {
     $sta_id = Status::getStatusID($new_status);
     $res = self::setStatus($issue_id, $sta_id);
     if ($res == 1) {
         // record history entry
         History::add($issue_id, $usr_id, 'remote_status_change', "Status remotely changed to '{status}' by {user}", array('status' => $new_status, 'user' => User::getFullName($usr_id)));
     }
     return $res;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:18,代码来源:class.issue.php

示例2: StatsChart

 /**
  * Plot various stats charts
  *
  * @param string $plotType
  * @param bool $hide_closed
  * @return bool return false if no data is available
  */
 public function StatsChart($plotType, $hide_closed)
 {
     // don't bother if user has no access
     $prj_id = Auth::getCurrentProject();
     if (Auth::getCurrentRole() <= User::getRoleID('Reporter') && Project::getSegregateReporters($prj_id)) {
         return false;
     }
     $colors = array();
     switch ($plotType) {
         case 'status':
             $data = Stats::getAssocStatus($hide_closed);
             $graph_title = ev_gettext('Issues by Status');
             // use same colors as defined for statuses
             foreach ($data as $sta_title => $trash) {
                 $sta_id = Status::getStatusID($sta_title);
                 $status_details = Status::getDetails($sta_id);
                 $colors[] = $status_details['sta_color'];
             }
             break;
         case 'release':
             $data = Stats::getAssocRelease($hide_closed);
             $graph_title = ev_gettext('Issues by Release');
             break;
         case 'priority':
             $data = Stats::getAssocPriority($hide_closed);
             $graph_title = ev_gettext('Issues by Priority');
             break;
         case 'user':
             $data = Stats::getAssocUser($hide_closed);
             $graph_title = ev_gettext('Issues by Assignment');
             break;
         case 'category':
             $data = Stats::getAssocCategory($hide_closed);
             $graph_title = ev_gettext('Issues by Category');
             break;
         default:
             return false;
     }
     // check the values coming from the database and if they are all empty, then
     // output a pre-generated 'No Data Available' picture
     if (!Stats::hasData($data)) {
         return false;
     }
     $plot = $this->create(360, 200);
     $plot->SetImageBorderType('plain');
     $plot->SetTitle($graph_title);
     $plot->SetPlotType('pie');
     $plot->SetDataType('text-data-single');
     if ($colors) {
         $plot->SetDataColors($colors);
     }
     $legend = $dataValue = array();
     foreach ($data as $label => $count) {
         $legend[] = $label . ' (' . $count . ')';
         $dataValue[] = array($label, $count);
     }
     $plot->SetDataValues($dataValue);
     foreach ($legend as $label) {
         $plot->SetLegend($label);
     }
     return $plot->DrawGraph();
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:69,代码来源:PlotHelper.php

示例3: 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

示例4: 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

示例5: setRemoteStatus

 /**
  * Method used to remotely set the status of a given issue.
  *
  * @access  public
  * @param   integer $issue_id The issue ID
  * @param   integer $usr_id The user ID of the person performing this change
  * @param   integer $new_status The new status ID
  * @return  integer 1 if the update worked, -1 otherwise
  */
 function setRemoteStatus($issue_id, $usr_id, $new_status)
 {
     $sta_id = Status::getStatusID($new_status);
     $res = Issue::setStatus($issue_id, $sta_id);
     if ($res == 1) {
         // record history entry
         History::add($issue_id, $usr_id, History::getTypeID('remote_status_change'), "Status remotely changed to '{$new_status}' by " . User::getFullName($usr_id));
     }
     return $res;
 }
开发者ID:juliogallardo1326,项目名称:proc,代码行数:19,代码来源:class.issue.php

示例6: subdate

include_once APP_INC_PATH . "class.issue.php";
include_once APP_INC_PATH . "class.status.php";
include_once APP_INC_PATH . "class.notification.php";
include_once APP_INC_PATH . "class.note.php";
include_once APP_INC_PATH . "db_access.php";
$day_limit = 4;
$sql = "SELECT \n\t\t\tiss_id,iss_prj_id\n\t\tFROM \n\t\t\t`ev_issue` \n\t\t\tleft join ev_status on sta_id = `iss_sta_id` \n\t\twhere \n\t\t\tsta_is_closed = 0 \n\t\t\tand `iss_control_status` = 'Answered' \n\t\t\tand iss_last_response_date < subdate(now(),interval {$day_limit} day);\n\t\t";
$issues = $GLOBALS["db_api"]->dbh->getAll($sql);
$closed_id = Status::getStatusID('Closed');
$c = 0;
$k = 0;
foreach ($issues as $issue) {
    $res = Issue::setStatus($issue[0], $closed_id);
    if ($res == 1) {
        History::add($HTTP_GET_VARS["iss_id"], 0, History::getTypeID('status_changed'), "Issue automatically set to status '" . Status::getStatusTitle(7) . "' due to ({$day_limit}) day inactivity ");
        Notification::notify($issue[0], 'closed');
    }
    $c++;
}
$killed_id = Status::getStatusID('Killed');
$sql = "SELECT \n\t\t\tiss_id\n\t\tFROM \n\t\t\t`ev_issue` \n\t\t\tleft join ev_status on sta_id = `iss_sta_id` \n\t\twhere \n\t\t\tsta_is_closed = 1\n\t\t\tand `iss_sta_id` = '{$killed_id}'\n\t\t";
$issues = $GLOBALS["db_api"]->dbh->getCol($sql);
foreach ($issues as $issue) {
    $GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_issue` where iss_id = '" . $issue . "'");
    $GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_subscription` where sub_iss_id = '" . $issue . "'");
    $GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_issue_user` where isu_iss_id = '" . $issue . "'");
    $GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_issue_history` where his_iss_id = '" . $issue . "'");
    $GLOBALS["db_api"]->dbh->query("DELETE FROM `ev_issue_user_replier` where iur_iss_id = '" . $issue . "'");
    $k++;
}
echo "({$c}) Closed. ({$k}) Deleted";
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:update_issues.php


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