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


PHP Issue::getPainTypesOrLabel方法代码示例

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


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

示例1: __

    ?>
</td>
                    <tr>
                        <td colspan="2" style="padding-top: 5px;">
                            <select name="pain_effect_id" id="pain_effect_id" style="width: 100%;">
                                <option value=""<?php 
    if (!$selected_pain_effect) {
        echo ' selected';
    }
    ?>
><?php 
    echo __('Not specified');
    ?>
</option>
                                <?php 
    foreach (\thebuggenie\core\entities\Issue::getPainTypesOrLabel('pain_effect') as $choice_id => $choice) {
        ?>
                                    <option value="<?php 
        echo $choice_id;
        ?>
"<?php 
        if ($selected_pain_effect == $choice_id) {
            ?>
 selected<?php 
        }
        ?>
><?php 
        echo $choice;
        ?>
</option>
                                <?php 
开发者ID:JonathanRH,项目名称:thebuggenie,代码行数:31,代码来源:_reportissue.inc.php

示例2: __

         echo __("Pain bug type on issue changed: %previous_value => %new_value", array('%previous_value' => '<strong>' . $previous_value . '</strong>', '%new_value' => '<strong>' . $new_value . '</strong>'));
     }
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_PAIN_EFFECT:
     echo image_tag('icon_priority.png');
     if ($item->hasChangeDetails()) {
         $previous_value = $item->getPreviousValue() ? \thebuggenie\core\entities\Issue::getPainTypesOrLabel('pain_effect', $item->getPreviousValue()) : __('Not determined');
         $new_value = $item->getCurrentValue() ? \thebuggenie\core\entities\Issue::getPainTypesOrLabel('pain_effect', $item->getCurrentValue()) : __('Not determined');
         echo __("Pain effect on issue changed: %previous_value => %new_value", array('%previous_value' => '<strong>' . $previous_value . '</strong>', '%new_value' => '<strong>' . $new_value . '</strong>'));
     }
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_PAIN_LIKELIHOOD:
     echo image_tag('icon_priority.png');
     if ($item->hasChangeDetails()) {
         $previous_value = $item->getPreviousValue() ? \thebuggenie\core\entities\Issue::getPainTypesOrLabel('pain_likelihood', $item->getPreviousValue()) : __('Not determined');
         $new_value = $item->getCurrentValue() ? \thebuggenie\core\entities\Issue::getPainTypesOrLabel('pain_likelihood', $item->getCurrentValue()) : __('Not determined');
         echo __("Likelihood on issue changed: %previous_value => %new_value", array('%previous_value' => '<strong>' . $previous_value . '</strong>', '%new_value' => '<strong>' . $new_value . '</strong>'));
     }
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_PAIN_CALCULATED:
     echo image_tag('icon_percent.png');
     if ($item->hasChangeDetails()) {
         echo __("Calculated pain on issue changed: %value", array('%value' => '<strong>' . $item->getText() . '</strong>'));
     }
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_USERS:
     echo image_tag('icon_user.png');
     if ($item->hasChangeDetails()) {
         $previous_value = $item->getPreviousValue() ? ($old_item = \thebuggenie\core\entities\User::getB2DBTable()->selectById($item->getPreviousValue())) ? __($old_item->getNameWithUsername()) : __('Unknown') : __('Not determined');
         $new_value = $item->getCurrentValue() ? ($new_item = \thebuggenie\core\entities\User::getB2DBTable()->selectById($item->getCurrentValue())) ? __($new_item->getNameWithUsername()) : __('Unknown') : __('Not determined');
         echo __("User working on issue changed: %previous_value => %new_value", array('%previous_value' => '<strong>' . $previous_value . '</strong>', '%new_value' => '<strong>' . $new_value . '</strong>'));
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:31,代码来源:_issuelogitem.inc.php

示例3: runIssueSetField


//.........这里部分代码省略.........
             }
             try {
                 $classname = null;
                 $parameter_name = mb_strtolower($request['field']);
                 $parameter_id_name = "{$parameter_name}_id";
                 $is_pain = in_array($parameter_name, array('pain_bug_type', 'pain_likelihood', 'pain_effect'));
                 if ($is_pain) {
                     switch ($parameter_name) {
                         case 'pain_bug_type':
                             $set_function_name = 'setPainBugType';
                             $is_changed_function_name = 'isPainBugTypeChanged';
                             $get_pain_type_label_function = 'getPainBugTypeLabel';
                             break;
                         case 'pain_likelihood':
                             $set_function_name = 'setPainLikelihood';
                             $is_changed_function_name = 'isPainLikelihoodChanged';
                             $get_pain_type_label_function = 'getPainLikelihoodLabel';
                             break;
                         case 'pain_effect':
                             $set_function_name = 'setPainEffect';
                             $is_changed_function_name = 'isPainEffectChanged';
                             $get_pain_type_label_function = 'getPainEffectLabel';
                             break;
                     }
                 } else {
                     $classname = "\\thebuggenie\\core\\entities\\" . ucfirst($parameter_name);
                     $lab_function_name = $classname;
                     $set_function_name = 'set' . ucfirst($parameter_name);
                     $is_changed_function_name = 'is' . ucfirst($parameter_name) . 'Changed';
                 }
                 if ($request->hasParameter($parameter_id_name)) {
                     $parameter_id = $request->getParameter($parameter_id_name);
                     if ($parameter_id !== 0) {
                         $is_valid = $is_pain ? in_array($parameter_id, array_keys(entities\Issue::getPainTypesOrLabel($parameter_name))) : $parameter_id == 0 || ($parameter = $lab_function_name::getB2DBTable()->selectByID($parameter_id)) instanceof $classname;
                     }
                     if ($parameter_id == 0 || $parameter_id !== 0 && $is_valid) {
                         if ($classname == '\\thebuggenie\\core\\entities\\Issuetype') {
                             $visible_fields = $issue->getIssuetype() instanceof entities\Issuetype ? $issue->getProject()->getVisibleFieldsArray($issue->getIssuetype()->getID()) : array();
                         } else {
                             $visible_fields = null;
                         }
                         $issue->{$set_function_name}($parameter_id);
                         if ($is_pain) {
                             if (!$issue->{$is_changed_function_name}()) {
                                 return $this->renderJSON(array('issue_id' => $issue->getID(), 'changed' => false, 'field' => array('id' => 0), 'user_pain' => $issue->getUserPain(), 'user_pain_diff_text' => $issue->getUserPainDiffText()));
                             }
                             return $parameter_id == 0 ? $this->renderJSON(array('issue_id' => $issue->getID(), 'changed' => true, 'field' => array('id' => 0), 'user_pain' => $issue->getUserPain(), 'user_pain_diff_text' => $issue->getUserPainDiffText())) : $this->renderJSON(array('issue_id' => $issue->getID(), 'changed' => true, 'field' => array('id' => $parameter_id, 'name' => $issue->{$get_pain_type_label_function}()), 'user_pain' => $issue->getUserPain(), 'user_pain_diff_text' => $issue->getUserPainDiffText()));
                         } else {
                             if (isset($parameter)) {
                                 $name = $parameter->getName();
                             } else {
                                 $name = null;
                             }
                             $field = array('id' => $parameter_id, 'name' => $name);
                             if ($classname == '\\thebuggenie\\core\\entities\\Issuetype') {
                                 framework\Context::loadLibrary('ui');
                                 $field['src'] = htmlspecialchars(framework\Context::getWebroot() . 'images/' . $issue->getIssuetype()->getIcon() . '_small.png');
                             }
                             if (!$issue->{$is_changed_function_name}()) {
                                 return $this->renderJSON(array('issue_id' => $issue->getID(), 'changed' => false, 'field' => $field));
                             }
                             if ($parameter_id == 0) {
                                 return $this->renderJSON(array('issue_id' => $issue->getID(), 'changed' => true, 'field' => array('id' => 0)));
                             } else {
                                 $options = array('issue_id' => $issue->getID(), 'changed' => true, 'visible_fields' => $visible_fields, 'field' => $field);
                                 if ($request['field'] == 'milestone') {
开发者ID:nrensen,项目名称:thebuggenie,代码行数:67,代码来源:Main.php


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