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


PHP Issue::getFormattedTime方法代码示例

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


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

示例1: runAssignEpic

 /**
  * Assign an issue to an epic
  *
  * @Route(url="/assign/issue/epic/:epic_id")
  *
  * @param framework\Request $request
  */
 public function runAssignEpic(framework\Request $request)
 {
     try {
         $epic = \thebuggenie\core\entities\Issue::getB2DBTable()->selectById((int) $request['epic_id']);
         $issue = \thebuggenie\core\entities\Issue::getB2DBTable()->selectById((int) $request['issue_id']);
         $epic->addChildIssue($issue, true);
         return $this->renderJSON(array('issue_id' => $issue->getID(), 'epic_id' => $epic->getID(), 'closed_pct' => $epic->getEstimatedPercentCompleted(), 'num_child_issues' => $epic->countChildIssues(), 'estimate' => \thebuggenie\core\entities\Issue::getFormattedTime($epic->getEstimatedTime()), 'text_color' => $epic->getAgileTextColor()));
     } catch (\Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('error' => framework\Context::getI18n()->__('An error occured when trying to assign the issue to the epic')));
     }
 }
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:19,代码来源:Main.php

示例2: __

<div class="results_summary">
    <div class="summary_header"><?php 
echo __('In the group above (on this page)');
?>
</div>
    <?php 
echo __('Total number of issues: %number', array('%number' => '<span class="issue_count">' . $current_count . '</span>'));
?>
<br>
    <?php 
echo __('Total estimated effort: %details', array('%details' => '<span class="issue_estimated_time_summary">' . \thebuggenie\core\entities\Issue::getFormattedTime($current_estimated_time, false) . '</span>'));
?>
<br>
    <?php 
echo __('Total current effort: %details', array('%details' => '<span class="issue_spent_time_summary">' . \thebuggenie\core\entities\Issue::getFormattedTime($current_spent_time, false) . '</span>'));
?>
<br>
</div>
开发者ID:founderio,项目名称:thebuggenie,代码行数:18,代码来源:_results_summary.inc.php

示例3:

                    </td>
                    <td class="sc_spent_time<?php 
    if (!$issue->hasSpentTime()) {
        ?>
 faded_out<?php 
    }
    ?>
"<?php 
    if (!in_array('spent_time', $visible_columns)) {
        ?>
 style="display: none;"<?php 
    }
    ?>
>
                        <?php 
    echo !$issue->hasSpentTime() ? '-' : \thebuggenie\core\entities\Issue::getFormattedTime($issue->getSpentTime(true, true));
    ?>
                    </td>
                    <td class="smaller sc_last_updated" title="<?php 
    echo tbg_formatTime($issue->getLastUpdatedTime(), 21);
    ?>
"<?php 
    if (!in_array('last_updated', $visible_columns)) {
        ?>
 style="display: none;"<?php 
    }
    ?>
><?php 
    echo tbg_formatTime($issue->getLastUpdatedTime(), 20);
    ?>
</td>
开发者ID:nrensen,项目名称:thebuggenie,代码行数:31,代码来源:_results_normal.inc.php

示例4: formatTimeableLog

 /**
  * Formats log time
  *
  * @param      $log
  * @param      $previous_value
  * @param      $current_value
  * @param bool $append_minutes
  * @param bool $subtract_hours
  *
  * @return string
  */
 public static function formatTimeableLog($time, $previous_value, $current_value, $append_minutes = false, $subtract_hours = false)
 {
     if (!$append_minutes && !$subtract_hours) {
         return $time;
     }
     $old_time = unserialize($previous_value);
     $new_time = unserialize($current_value);
     if ($append_minutes) {
         if (isset($old_time['hours']) && isset($old_time['minutes'])) {
             $old_time['hours'] += (int) floor($old_time['minutes'] / 60);
         }
         if (isset($new_time['hours']) && isset($new_time['minutes'])) {
             $new_time['hours'] += (int) floor($new_time['minutes'] / 60);
         }
     }
     if ($subtract_hours) {
         if (isset($old_time['minutes'])) {
             $old_time['minutes'] = $old_time['minutes'] % 60;
         }
         if (isset($new_time['minutes'])) {
             $new_time['minutes'] = $new_time['minutes'] % 60;
         }
     }
     return \thebuggenie\core\entities\Issue::getFormattedTime($old_time) . ' &rArr; ' . \thebuggenie\core\entities\Issue::getFormattedTime($new_time);
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:36,代码来源:Timeable.php

示例5: tbg_formatTime

 $sheet->setCellValueByColumnAndRow(4, $cc, $issue->getDescription());
 $sheet->setCellValueByColumnAndRow(5, $cc, $issue->getReproductionSteps());
 $sheet->setCellValueByColumnAndRow(6, $cc, $posted_by);
 $sheet->setCellValueByColumnAndRow(7, $cc, $assignee);
 $sheet->setCellValueByColumnAndRow(8, $cc, $status);
 $sheet->setCellValueByColumnAndRow(9, $cc, $category);
 $sheet->setCellValueByColumnAndRow(10, $cc, $priority);
 $sheet->setCellValueByColumnAndRow(11, $cc, $reproducability);
 $sheet->setCellValueByColumnAndRow(12, $cc, $severity);
 $sheet->setCellValueByColumnAndRow(13, $cc, $resolution);
 $sheet->setCellValueByColumnAndRow(14, $cc, $milestone);
 $sheet->setCellValueByColumnAndRow(15, $cc, tbg_formatTime($issue->getPosted(), 21));
 $sheet->setCellValueByColumnAndRow(16, $cc, tbg_formatTime($issue->getLastUpdatedTime(), 21));
 $sheet->setCellValueByColumnAndRow(17, $cc, $issue->getPercentCompleted() . '%');
 $sheet->setCellValueByColumnAndRow(18, $cc, !$issue->hasEstimatedTime() ? '-' : \thebuggenie\core\entities\Issue::getFormattedTime($issue->getEstimatedTime(true, true)));
 $sheet->setCellValueByColumnAndRow(19, $cc, !$issue->hasSpentTime() ? '-' : \thebuggenie\core\entities\Issue::getFormattedTime($issue->getSpentTime(true, true)));
 $sheet->setCellValueByColumnAndRow(20, $cc, $issue->getUserpain());
 $sheet->setCellValueByColumnAndRow(21, $cc, $issue->getVotes());
 $start_column = 22;
 foreach ($custom_columns as $column) {
     $value = $issue->getCustomField($column->getKey());
     switch ($column->getType()) {
         case \thebuggenie\core\entities\CustomDatatype::DATE_PICKER:
             $value = strtotime($value) !== false ? tbg_formatTime($value, 20) : '';
             break;
         case \thebuggenie\core\entities\CustomDatatype::DROPDOWN_CHOICE_TEXT:
         case \thebuggenie\core\entities\CustomDatatype::RADIO_CHOICE:
             $value = $value instanceof \thebuggenie\core\entities\CustomDatatypeOption ? $value->getValue() : '';
             break;
         case \thebuggenie\core\entities\CustomDatatype::CLIENT_CHOICE:
         case \thebuggenie\core\entities\CustomDatatype::COMPONENTS_CHOICE:
开发者ID:founderio,项目名称:thebuggenie,代码行数:31,代码来源:_results_normal_sheet.inc.php

示例6: _processChanges


//.........这里部分代码省略.........
                             $old_name = ($old_item = \thebuggenie\core\entities\Severity::getB2DBTable()->selectById($original_value)) ? $old_item->getName() : framework\Context::getI18n()->__('Unknown');
                         } else {
                             $old_name = framework\Context::getI18n()->__('Not determined');
                         }
                         $new_name = $this->getSeverity() instanceof Datatype ? $this->getSeverity()->getName() : framework\Context::getI18n()->__('Not determined');
                         $this->addLogEntry(tables\Log::LOG_ISSUE_SEVERITY, $old_name . ' &rArr; ' . $new_name, $original_value, $compare_value);
                         break;
                     case '_milestone':
                         if ($original_value != 0) {
                             $old_name = ($old_item = \thebuggenie\core\entities\Milestone::getB2DBTable()->selectById($original_value)) ? $old_item->getName() : framework\Context::getI18n()->__('Not determined');
                         } else {
                             $old_name = framework\Context::getI18n()->__('Not determined');
                         }
                         $new_name = $this->getMilestone() instanceof \thebuggenie\core\entities\Milestone ? $this->getMilestone()->getName() : framework\Context::getI18n()->__('Not determined');
                         $this->addLogEntry(tables\Log::LOG_ISSUE_MILESTONE, $old_name . ' &rArr; ' . $new_name, $original_value, $compare_value);
                         $this->_milestone_order = 0;
                         break;
                     case '_issuetype':
                         if ($original_value != 0) {
                             $old_name = ($old_item = Issuetype::getB2DBTable()->selectById($original_value)) ? $old_item->getName() : framework\Context::getI18n()->__('Unknown');
                         } else {
                             $old_name = framework\Context::getI18n()->__('Unknown');
                         }
                         $new_name = $this->getIssuetype() instanceof \thebuggenie\core\entities\Issuetype ? $this->getIssuetype()->getName() : framework\Context::getI18n()->__('Unknown');
                         $this->addLogEntry(tables\Log::LOG_ISSUE_ISSUETYPE, $old_name . ' &rArr; ' . $new_name, $original_value, $compare_value);
                         break;
                     case '_estimated_months':
                     case '_estimated_weeks':
                     case '_estimated_days':
                     case '_estimated_hours':
                     case '_estimated_points':
                         if (!$is_saved_estimated) {
                             $old_time = array('months' => $this->getChangedPropertyOriginal('_estimated_months'), 'weeks' => $this->getChangedPropertyOriginal('_estimated_weeks'), 'days' => $this->getChangedPropertyOriginal('_estimated_days'), 'hours' => $this->getChangedPropertyOriginal('_estimated_hours'), 'points' => $this->getChangedPropertyOriginal('_estimated_points'));
                             $old_formatted_time = array_sum($old_time) > 0 ? Issue::getFormattedTime($old_time) : framework\Context::getI18n()->__('Not estimated');
                             $new_formatted_time = $this->hasEstimatedTime() ? Issue::getFormattedTime($this->getEstimatedTime()) : framework\Context::getI18n()->__('Not estimated');
                             $this->addLogEntry(tables\Log::LOG_ISSUE_TIME_ESTIMATED, $old_formatted_time . ' &rArr; ' . $new_formatted_time, serialize($old_time), serialize($this->getEstimatedTime()));
                             $is_saved_estimated = true;
                         }
                         break;
                     case '_spent_months':
                     case '_spent_weeks':
                     case '_spent_days':
                     case '_spent_hours':
                     case '_spent_points':
                         if (!$is_saved_spent) {
                             $old_time = array('months' => $this->getChangedPropertyOriginal('_spent_months'), 'weeks' => $this->getChangedPropertyOriginal('_spent_weeks'), 'days' => $this->getChangedPropertyOriginal('_spent_days'), 'hours' => round($this->getChangedPropertyOriginal('_spent_hours') / 100, 2), 'points' => $this->getChangedPropertyOriginal('_spent_points'));
                             $old_formatted_time = array_sum($old_time) > 0 ? Issue::getFormattedTime($old_time) : framework\Context::getI18n()->__('No time spent');
                             $new_formatted_time = $this->hasSpentTime() ? Issue::getFormattedTime($this->getSpentTime()) : framework\Context::getI18n()->__('No time spent');
                             $this->addLogEntry(tables\Log::LOG_ISSUE_TIME_SPENT, $old_formatted_time . ' &rArr; ' . $new_formatted_time, serialize($old_time), serialize($this->getSpentTime()));
                             $is_saved_spent = true;
                         }
                         break;
                     case '_state':
                         if ($this->isClosed()) {
                             $this->addLogEntry(tables\Log::LOG_ISSUE_CLOSE);
                             if ($this->getMilestone() instanceof \thebuggenie\core\entities\Milestone) {
                                 if ($this->getMilestone()->isSprint()) {
                                     if (!$this->getIssueType()->isTask()) {
                                         $this->setSpentPoints($this->getEstimatedPoints());
                                     } else {
                                         if ($this->getSpentHours() < $this->getEstimatedHours()) {
                                             $this->setSpentHours($this->getEstimatedHours());
                                         }
                                         foreach ($this->getParentIssues() as $parent_issue) {
                                             if ($parent_issue->checkTaskStates()) {
                                                 $related_issues_to_save[$parent_issue->getID()] = true;
开发者ID:AzerothShard,项目名称:thebuggenie,代码行数:67,代码来源:Issue.php

示例7: __

echo $epic->getStatus() instanceof \thebuggenie\core\entities\Datatype ? $epic->getStatus()->getColor() : '#FFF';
?>
;" title="<?php 
echo $epic->getStatus() instanceof \thebuggenie\core\entities\Datatype ? $epic->getStatus()->getName() : __('Unknown');
?>
">&nbsp;&nbsp;&nbsp;</div><?php 
echo $epic->getStatus() instanceof \thebuggenie\core\entities\Status ? $epic->getStatus()->getName() : __('Not determined');
?>
</dd>
        <dt><?php 
echo __('Estimate');
?>
</dt>
        <dd id="epic_<?php 
echo $epic->getID();
?>
_estimate"><?php 
echo \thebuggenie\core\entities\Issue::getFormattedTime($epic->getEstimatedTime(true, true));
?>
</dd>
        <dt><?php 
echo __('Child issues');
?>
</dt>
        <dd><?php 
echo __('%num_child_issues issue(s)', array('%num_child_issues' => '<span id="epic_' . $epic->getID() . '_child_issues_count">' . $epic->countChildIssues() . '</span>'));
?>
</dd>
    </dl>
</li>
开发者ID:founderio,项目名称:thebuggenie,代码行数:30,代码来源:_milestoneepic.inc.php

示例8: make_url

?>
_name"<?php 
if (!$issue->hasSpentTime()) {
    ?>
 style="display: none;"<?php 
}
?>
>
                        <a href="javascript:void(0)" onclick="TBG.Main.Helpers.Backdrop.show('<?php 
echo make_url('get_partial_for_backdrop', array('key' => 'issue_spenttimes', 'issue_id' => $issue->getID()));
?>
');" id="spent_time_<?php 
echo $issue->getID();
?>
_value"><?php 
echo \thebuggenie\core\entities\Issue::getFormattedTime($issue->getSpentTime());
?>
</a>
                    </span>
                    <span class="faded_out" id="no_spent_time_<?php 
echo $issue->getID();
?>
"<?php 
if ($issue->hasSpentTime()) {
    ?>
 style="display: none;"<?php 
}
?>
><?php 
echo __('No time spent');
?>
开发者ID:RTechSoft,项目名称:thebuggenie,代码行数:31,代码来源:_issuedetailslisteditable.inc.php

示例9: runIssueRevertField

 /**
  * Reverts an issue field back to the original value
  *
  * @param \thebuggenie\core\framework\Request $request
  */
 public function runIssueRevertField(framework\Request $request)
 {
     if ($issue_id = $request['issue_id']) {
         try {
             $issue = entities\Issue::getB2DBTable()->selectById($issue_id);
         } catch (\Exception $e) {
             $this->getResponse()->setHttpStatus(400);
             return $this->renderText('fail');
         }
     } else {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderText('no issue');
     }
     $field = null;
     framework\Context::loadLibrary('common');
     switch ($request['field']) {
         case 'description':
             $issue->revertDescription();
             $issue->revertDescription_Syntax();
             $field = array('id' => (int) ($issue->getDescription() != ''), 'name' => $issue->getParsedDescription(array('issue' => $issue)), 'form_value' => $issue->getDescription());
             break;
         case 'reproduction_steps':
             $issue->revertReproduction_Steps();
             $issue->revertReproduction_Steps_Syntax();
             $field = array('id' => (int) ($issue->getReproductionSteps() != ''), 'name' => $issue->getParsedReproductionSteps(array('issue' => $issue)), 'form_value' => $issue->getReproductionSteps());
             break;
         case 'title':
             $issue->revertTitle();
             $field = array('id' => 1, 'name' => strip_tags($issue->getTitle()));
             break;
         case 'shortname':
             $issue->revertShortname();
             $field = array('id' => 1, 'name' => strip_tags($issue->getShortname()));
             break;
         case 'category':
             $issue->revertCategory();
             $field = $issue->getCategory() instanceof entities\Category ? array('id' => $issue->getCategory()->getID(), 'name' => $issue->getCategory()->getName()) : array('id' => 0);
             break;
         case 'resolution':
             $issue->revertResolution();
             $field = $issue->getResolution() instanceof entities\Resolution ? array('id' => $issue->getResolution()->getID(), 'name' => $issue->getResolution()->getName()) : array('id' => 0);
             break;
         case 'severity':
             $issue->revertSeverity();
             $field = $issue->getSeverity() instanceof entities\Severity ? array('id' => $issue->getSeverity()->getID(), 'name' => $issue->getSeverity()->getName()) : array('id' => 0);
             break;
         case 'reproducability':
             $issue->revertReproducability();
             $field = $issue->getReproducability() instanceof entities\Reproducability ? array('id' => $issue->getReproducability()->getID(), 'name' => $issue->getReproducability()->getName()) : array('id' => 0);
             break;
         case 'priority':
             $issue->revertPriority();
             $field = $issue->getPriority() instanceof entities\Priority ? array('id' => $issue->getPriority()->getID(), 'name' => $issue->getPriority()->getName()) : array('id' => 0);
             break;
         case 'percent_complete':
             $issue->revertPercentCompleted();
             $field = $issue->getPercentCompleted();
             break;
         case 'status':
             $issue->revertStatus();
             $field = $issue->getStatus() instanceof entities\Status ? array('id' => $issue->getStatus()->getID(), 'name' => $issue->getStatus()->getName(), 'color' => $issue->getStatus()->getColor()) : array('id' => 0);
             break;
         case 'pain_bug_type':
             $issue->revertPainBugType();
             $field = $issue->hasPainBugType() ? array('id' => $issue->getPainBugType(), 'name' => $issue->getPainBugTypeLabel(), 'user_pain' => $issue->getUserPain()) : array('id' => 0, 'user_pain' => $issue->getUserPain());
             break;
         case 'pain_likelihood':
             $issue->revertPainLikelihood();
             $field = $issue->hasPainLikelihood() ? array('id' => $issue->getPainLikelihood(), 'name' => $issue->getPainLikelihoodLabel(), 'user_pain' => $issue->getUserPain()) : array('id' => 0, 'user_pain' => $issue->getUserPain());
             break;
         case 'pain_effect':
             $issue->revertPainEffect();
             $field = $issue->hasPainEffect() ? array('id' => $issue->getPainEffect(), 'name' => $issue->getPainEffectLabel(), 'user_pain' => $issue->getUserPain()) : array('id' => 0, 'user_pain' => $issue->getUserPain());
             break;
         case 'issuetype':
             $issue->revertIssuetype();
             $field = $issue->getIssuetype() instanceof entities\Issuetype ? array('id' => $issue->getIssuetype()->getID(), 'name' => $issue->getIssuetype()->getName(), 'src' => htmlspecialchars(framework\Context::getWebroot() . 'images/' . $issue->getIssuetype()->getIcon() . '_small.png')) : array('id' => 0);
             $visible_fields = $issue->getIssuetype() instanceof entities\Issuetype ? $issue->getProject()->getVisibleFieldsArray($issue->getIssuetype()->getID()) : array();
             return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $field, 'visible_fields' => $visible_fields));
             break;
         case 'milestone':
             $issue->revertMilestone();
             $field = $issue->getMilestone() instanceof entities\Milestone ? array('id' => $issue->getMilestone()->getID(), 'name' => $issue->getMilestone()->getName()) : array('id' => 0);
             break;
         case 'estimated_time':
             $issue->revertEstimatedTime();
             return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $issue->hasEstimatedTime() ? array('id' => 1, 'name' => entities\Issue::getFormattedTime($issue->getEstimatedTime(true, true))) : array('id' => 0), 'values' => $issue->getEstimatedTime(true, true), 'percentbar' => $this->getComponentHTML('main/percentbar', array('percent' => $issue->getEstimatedPercentCompleted(), 'height' => 3))));
             break;
         case 'spent_time':
             $issue->revertSpentTime();
             return $this->renderJSON(array('ok' => true, 'issue_id' => $issue->getID(), 'field' => $issue->hasSpentTime() ? array('id' => 1, 'name' => entities\Issue::getFormattedTime($issue->getSpentTime(true, true))) : array('id' => 0), 'values' => $issue->getSpentTime(true, true)));
             break;
         case 'owned_by':
             $issue->revertOwner();
             return $this->renderJSON(array('changed' => $issue->isOwnerChanged(), 'field' => $issue->isOwned() ? array('id' => $issue->getOwner()->getID(), 'name' => $issue->getOwner() instanceof entities\User ? $this->getComponentHTML('main/userdropdown', array('user' => $issue->getOwner())) : $this->getComponentHTML('main/teamdropdown', array('team' => $issue->getOwner()))) : array('id' => 0)));
//.........这里部分代码省略.........
开发者ID:nrensen,项目名称:thebuggenie,代码行数:101,代码来源:Main.php

示例10: tbg_formatTime

    ?>
">
                        <td><?php 
    echo tbg_formatTime($spent_time->getEditedAt(), 14);
    ?>
</td>
                        <td style="font-size: 0.9em;"><?php 
    echo $spent_time->getActivityType() instanceof \thebuggenie\core\entities\ActivityType ? $spent_time->getActivityType()->getName() : '-';
    ?>
</td>
                        <td><?php 
    echo include_component('main/userdropdown', array('user' => $spent_time->getUser()));
    ?>
</td>
                        <td style="text-align: right;"><?php 
    echo \thebuggenie\core\entities\Issue::getFormattedTime($spent_time->getSpentTime(true, true));
    ?>
</td>
                        <td style="text-align: right;" class="button-group" <?php 
    if ($spent_time->getComment()) {
        ?>
rowspan="2"<?php 
    }
    ?>
>
                            <a href="javascript:void(0);" style="float: none;" class="button button-silver last" onclick="TBG.Main.Helpers.Backdrop.show('<?php 
    echo make_url('get_partial_for_backdrop', array('key' => 'issue_spenttime', 'entry_id' => $spent_time->getID()));
    ?>
');"><?php 
    echo __('Edit');
    ?>
开发者ID:founderio,项目名称:thebuggenie,代码行数:31,代码来源:_issuespenttimes.inc.php


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