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


PHP Issue::getPriority方法代码示例

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


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

示例1: getValue

 /**
  * Returns the current value for the specified field / issue. This method just calls
  * the appropriate class / method
  *
  * @param   integer $issue_id
  * @param   integer $field_name
  * @return  mixed
  */
 private static function getValue($issue_id, $field_name)
 {
     switch ($field_name) {
         case 'assignee':
             return Issue::getAssignedUserIDs($issue_id);
         case 'priority':
             return Issue::getPriority($issue_id);
         case 'severity':
             return Issue::getSeverity($issue_id);
     }
     return false;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:20,代码来源:class.issue_field.php

示例2: getSpecializedHeaders

 /**
  * Generates the specialized headers for an email.
  *
  * @param   integer $issue_id The issue ID
  * @param   string $type The type of message this is
  * @param   string $headers The existing headers of this message.
  * @param   integer $sender_usr_id The id of the user sending this email.
  * @return  array An array of specialized headers
  */
 public static function getSpecializedHeaders($issue_id, $type, $headers, $sender_usr_id)
 {
     $new_headers = array();
     if (!empty($issue_id)) {
         $prj_id = Issue::getProjectID($issue_id);
         if (count(Group::getAssocList($prj_id)) > 0) {
             // group issue is currently assigned too
             $new_headers['X-Eventum-Group-Issue'] = Group::getName(Issue::getGroupID($issue_id));
             // group of whoever is sending this message.
             if (empty($sender_usr_id)) {
                 $new_headers['X-Eventum-Group-Replier'] = $new_headers['X-Eventum-Group-Issue'];
             } else {
                 $new_headers['X-Eventum-Group-Replier'] = Group::getName(User::getGroupID($sender_usr_id));
             }
             // group of current assignee
             $assignees = Issue::getAssignedUserIDs($issue_id);
             if (empty($assignees[0])) {
                 $new_headers['X-Eventum-Group-Assignee'] = '';
             } else {
                 $new_headers['X-Eventum-Group-Assignee'] = @Group::getName(User::getGroupID($assignees[0]));
             }
         }
         if (CRM::hasCustomerIntegration($prj_id)) {
             $crm = CRM::getInstance($prj_id);
             try {
                 $customer = $crm->getCustomer(Issue::getCustomerID($issue_id));
                 $new_headers['X-Eventum-Customer'] = $customer->getName();
             } catch (CustomerNotFoundException $e) {
             }
             try {
                 $contract = $crm->getContract(Issue::getContractID($issue_id));
                 $support_level = $contract->getSupportLevel();
                 if (is_object($support_level)) {
                     $new_headers['X-Eventum-Level'] = $support_level->getName();
                 }
             } catch (ContractNotFoundException $e) {
             }
         }
         // add assignee header
         $new_headers['X-Eventum-Assignee'] = implode(',', User::getEmail(Issue::getAssignedUserIDs($issue_id)));
         $new_headers['X-Eventum-Category'] = Category::getTitle(Issue::getCategory($issue_id));
         $new_headers['X-Eventum-Project'] = Project::getName($prj_id);
         $new_headers['X-Eventum-Priority'] = Priority::getTitle(Issue::getPriority($issue_id));
         // handle custom fields
         $cf_values = Custom_Field::getValuesByIssue($prj_id, $issue_id);
         $cf_titles = Custom_Field::getFieldsToBeListed($prj_id);
         foreach ($cf_values as $fld_id => $values) {
             // skip empty titles
             // TODO: why they are empty?
             if (!isset($cf_titles[$fld_id])) {
                 continue;
             }
             // skip empty values
             if (empty($values)) {
                 continue;
             }
             $cf_value = implode(', ', (array) $values);
             // value could be empty after multivalued field join
             if (empty($cf_value)) {
                 continue;
             }
             // convert spaces for header fields
             $cf_title = str_replace(' ', '_', $cf_titles[$fld_id]);
             $new_headers['X-Eventum-CustomField-' . $cf_title] = $cf_value;
         }
     }
     $new_headers['X-Eventum-Type'] = $type;
     return $new_headers;
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:78,代码来源:class.mail_helper.php

示例3: bulkUpdate

 /**
  * Method used to bulk update a list of issues
  *
  * @access  public
  * @return  boolean
  */
 function bulkUpdate()
 {
     global $HTTP_POST_VARS;
     // check if user performing this chance has the proper role
     if (Auth::getCurrentRole() < User::getRoleID('Manager')) {
         return -1;
     }
     $items = Misc::escapeInteger($HTTP_POST_VARS['item']);
     $new_status_id = Misc::escapeInteger($_POST['status']);
     $new_release_id = Misc::escapeInteger($_POST['release']);
     $new_priority_id = Misc::escapeInteger($_POST['priority']);
     $new_category_id = Misc::escapeInteger($_POST['category']);
     $new_project_id = Misc::escapeInteger($_POST['project']);
     for ($i = 0; $i < count($items); $i++) {
         if (!Issue::canAccess($items[$i], Auth::getUserID())) {
             continue;
         } elseif (Issue::getProjectID($HTTP_POST_VARS['item'][$i]) != Auth::getCurrentProject()) {
             // make sure issue is not in another project
             continue;
         }
         $updated_fields = array();
         // update assignment
         if (count(@$HTTP_POST_VARS['users']) > 0) {
             $users = Misc::escapeInteger($HTTP_POST_VARS['users']);
             // get who this issue is currently assigned too
             $stmt = "SELECT\n                            isu_usr_id,\n                            CONCAT(en_firstname,' ', en_lastname) as usr_full_name\n                         FROM\n                            " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user,\n                            " . ETEL_USER_TABLE_NOSUB . "\n                         WHERE\n                            isu_usr_id = en_ID AND\n                            isu_iss_id = " . $items[$i];
             $current_assignees = $GLOBALS["db_api"]->dbh->getAssoc($stmt);
             if (PEAR::isError($current_assignees)) {
                 Error_Handler::logError(array($current_assignees->getMessage(), $current_assignees->getDebugInfo()), __FILE__, __LINE__);
                 return -1;
             }
             foreach ($current_assignees as $usr_id => $usr_name) {
                 if (!in_array($usr_id, $users)) {
                     Issue::deleteUserAssociation($items[$i], $usr_id, false);
                 }
             }
             $new_user_names = array();
             $new_assignees = array();
             foreach ($users as $usr_id) {
                 $new_user_names[$usr_id] = User::getFullName($usr_id);
                 // check if the issue is already assigned to this person
                 $stmt = "SELECT\n                                COUNT(*) AS total\n                             FROM\n                                " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user\n                             WHERE\n                                isu_iss_id=" . $items[$i] . " AND\n                                isu_usr_id=" . $usr_id;
                 $total = $GLOBALS["db_api"]->dbh->getOne($stmt);
                 if ($total > 0) {
                     continue;
                 } else {
                     $new_assignees[] = $usr_id;
                     // add the assignment
                     Issue::addUserAssociation(Auth::getUserID(), $items[$i], $usr_id, false);
                     Notification::subscribeUser(Auth::getUserID(), $items[$i], $usr_id, Notification::getAllActions());
                     Workflow::handleAssignment(Auth::getCurrentProject(), $items[$i], Auth::getUserID());
                 }
             }
             Notification::notifyNewAssignment($new_assignees, $items[$i]);
             $updated_fields['Assignment'] = History::formatChanges(join(', ', $current_assignees), join(', ', $new_user_names));
         }
         // update status
         if (!empty($new_status_id)) {
             $old_status_id = Issue::getStatusID($items[$i]);
             $res = Issue::setStatus($items[$i], $new_status_id, false);
             if ($res == 1) {
                 $updated_fields['Status'] = History::formatChanges(Status::getStatusTitle($old_status_id), Status::getStatusTitle($new_status_id));
             }
         }
         // update release
         if (!empty($new_release_id)) {
             $old_release_id = Issue::getRelease($items[$i]);
             $res = Issue::setRelease($items[$i], $new_release_id);
             if ($res == 1) {
                 $updated_fields['Release'] = History::formatChanges(Release::getTitle($old_release_id), Release::getTitle($new_release_id));
             }
         }
         // update priority
         if (!empty($new_priority_id)) {
             $old_priority_id = Issue::getPriority($items[$i]);
             $res = Issue::setPriority($items[$i], $new_priority_id);
             if ($res == 1) {
                 $updated_fields['Priority'] = History::formatChanges(Priority::getTitle($old_priority_id), Priority::getTitle($new_priority_id));
             }
         }
         // update category
         if (!empty($new_category_id)) {
             $old_category_id = Issue::getCategory($items[$i]);
             $res = Issue::setCategory($items[$i], $new_category_id);
             if ($res == 1) {
                 $updated_fields['Category'] = History::formatChanges(Category::getTitle($old_category_id), Category::getTitle($new_category_id));
             }
         }
         // update project
         if (!empty($new_project_id)) {
             $old_project_id = Issue::getProjectID($items[$i]);
             $res = Issue::setProject($items[$i], $new_project_id);
             if ($res == 1) {
                 $updated_fields['Project'] = History::formatChanges(Category::getTitle($old_project_id), Category::getTitle($new_project_id));
//.........这里部分代码省略.........
开发者ID:juliogallardo1326,项目名称:proc,代码行数:101,代码来源:class.issue.php


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