public function do_execute()
 {
     if (\thebuggenie\core\framework\Context::isInstallmode()) {
         $this->cliEcho("The Bug Genie is not installed\n", 'red');
     } else {
         $this->cliEcho("Finding times to fix\n", 'white', 'bold');
         $issuetimes = \thebuggenie\core\entities\tables\IssueSpentTimes::getTable()->getAllSpentTimesForFixing();
         $error_issues = array();
         foreach ($issuetimes as $issue_id => $times) {
             if (count($times) > 1) {
                 $this->cliEcho("Fixing times spent for issue ID {$issue_id}, " . count($times) . " entries\n");
                 $prev_times = \thebuggenie\core\entities\common\Timeable::getZeroedUnitsWithPoints();
                 foreach ($times as $k => $row) {
                     if ($row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_POINTS] < $prev_times['points'] || $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_HOURS] < $prev_times['minutes'] || $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_HOURS] < $prev_times['hours'] || $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_DAYS] < $prev_times['days'] || $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_WEEKS] < $prev_times['weeks'] || $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_MONTHS] < $prev_times['months']) {
                         $error_issues[] = $issue_id;
                     } else {
                         \thebuggenie\core\entities\tables\IssueSpentTimes::getTable()->fixRow($row, $prev_times);
                         $prev_times['points'] += $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_POINTS];
                         $prev_times['minutes'] += $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_MINUTES];
                         $prev_times['hours'] += $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_HOURS];
                         $prev_times['days'] += $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_DAYS];
                         $prev_times['weeks'] += $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_WEEKS];
                         $prev_times['months'] += $row[\thebuggenie\core\entities\tables\IssueSpentTimes::SPENT_MONTHS];
                     }
                 }
             }
         }
         foreach (\thebuggenie\core\entities\tables\IssueSpentTimes::getTable()->getAllSpentTimesForFixing() as $issue_id => $times) {
             foreach ($times as $row) {
                 \thebuggenie\core\entities\tables\IssueSpentTimes::getTable()->fixHours($row);
             }
             \thebuggenie\core\entities\tables\Issues::getTable()->fixHours($issue_id);
         }
         if (count($error_issues) > 0) {
             $this->cliEcho("\n");
             $this->cliEcho("All spent times have been attempted fixed, but there were some issues that could not be fixed automatically!\n");
             $this->cliEcho("This happens if there has been adjustments in time spent, lowering the value for spent points, minutes, hours, days, weeks or months.\n\n");
             $this->cliEcho("You should fix the issues manually (issue ids corresponding to issue_ids in the timesspent table): ");
             $this->cliEcho(join(', ', $error_issues) . "\n\n");
             $this->cliEcho("Spent times fixed!\n\n", 'green');
         } else {
             $this->cliEcho("All spent times fixed successfully!\n\n", 'green');
         }
         $this->cliEcho("IMPORTANT: Don't run this task again!\n", 'white', 'bold');
     }
 }
 public function runIssueEditTimeSpent(framework\Request $request)
 {
     try {
         $entry_id = $request['entry_id'];
         $spenttime = $entry_id ? tables\IssueSpentTimes::getTable()->selectById($entry_id) : new entities\IssueSpentTime();
         if ($issue_id = $request['issue_id']) {
             $issue = entities\Issue::getB2DBTable()->selectById($issue_id);
         } else {
             throw new \Exception('no issue');
         }
         framework\Context::loadLibrary('common');
         $spenttime->editOrAdd($issue, $this->getUser(), array_only_with_default($request->getParameters(), array_merge(array('timespent_manual', 'timespent_specified_type', 'timespent_specified_value', 'timespent_activitytype', 'timespent_comment', 'edited_at'), \thebuggenie\core\entities\common\Timeable::getUnitsWithPoints())));
     } catch (\Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('edited' => 'error', 'error' => $e->getMessage()));
     }
     $this->return_data = array('edited' => 'ok');
 }
                    <td style="padding: 5px; border-top: 1px dotted #AAA; border-bottom: 1px dotted #AAA; font-weight: bold; font-size: 12px;"><?php 
    echo __('Total remaining effort');
    ?>
</td>
                    <td style="width: 50px; border-top: 1px dotted #AAA; border-bottom: 1px dotted #AAA; font-size: 13px; font-weight: bold; text-align: center; padding: 5px;" id="scrum_sprint_<?php 
    echo $milestone->getID();
    ?>
_remaining_points"><?php 
    echo $milestone->getPointsEstimated() - $milestone->getPointsSpent();
    ?>
</td>
                    <td style="width: 50px; border-top: 1px dotted #AAA; border-bottom: 1px dotted #AAA; font-size: 13px; font-weight: bold; text-align: center; padding: 5px;" id="scrum_sprint_<?php 
    echo $milestone->getID();
    ?>
_remaining_hours"><?php 
    echo \thebuggenie\core\entities\common\Timeable::formatHoursAndMinutes($milestone->getHoursEstimated(true) - $milestone->getHoursSpent(true), $milestone->getMinutesEstimated(true) - $milestone->getMinutesSpent(true));
    ?>
</td>
                    <td style="padding: 5px; border-top: 1px dotted #AAA; border-bottom: 1px dotted #AAA; font-weight: bold; font-size: 12px;">&nbsp;</td>
                </tr>
            </tbody>
        </table>
        <script type="text/javascript">
            require(['domReady', 'thebuggenie/tbg', 'jquery', 'jquery.flot', 'jquery.flot.time', 'jquery.flot.dashes'], function (domReady, TBG, jQuery) {
                domReady(function () {
                    jQuery(function () {

                        var d_e_points = [];
                        var d_e_hours = [];
                        var d_s_points = [];
                        var d_s_hours = [];
}
$current_count = 0;
$current_estimated_time = \thebuggenie\core\entities\common\Timeable::getZeroedUnitsWithPoints();
$current_spent_time = $current_estimated_time;
$cc = 1;
foreach ($search_object->getIssues() as $issue) {
    // shows only issues with permissions, useful when if we're including subprojects
    if (!$issue->hasAccess()) {
        return;
    }
    list($showtablestart, $showheader, $prevgroup_id, $groupby_description) = \thebuggenie\core\modules\search\controllers\Main::resultGrouping($issue, $search_object->getGroupBy(), $cc, $prevgroup_id);
    if (($showtablestart || $showheader) && $cc > 1) {
        echo '</tbody></table>';
        include_component('search/results_summary', compact('current_count', 'current_estimated_time', 'current_spent_time'));
        $current_count = 0;
        $current_estimated_time = \thebuggenie\core\entities\common\Timeable::getZeroedUnitsWithPoints();
        $current_spent_time = $current_estimated_time;
    }
    $current_count++;
    $estimate = $issue->getEstimatedTime(true, true);
    $spenttime = $issue->getSpentTime(true, true);
    foreach ($current_estimated_time as $key => $value) {
        $current_estimated_time[$key] += $estimate[$key];
    }
    foreach ($current_spent_time as $key => $value) {
        $current_spent_time[$key] += $spenttime[$key];
    }
    if ($showheader) {
        ?>
        <h5>
            <?php 
Beispiel #5
0
     echo '<i>' . __('Resolution changed: %text', array('%text' => $log_action['text'])) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_PERCENT:
     echo '<i>' . __('Percent completed: %text', array('%text' => $log_action['text'])) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_MILESTONE:
     echo '<i>' . __('Target milestone changed: %text', array('%text' => $log_action['text'])) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_ISSUETYPE:
     echo '<i>' . __('Issue type changed: %text', array('%text' => $log_action['text'])) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_TIME_ESTIMATED:
     echo '<i>' . __('Estimation changed: %text', array('%text' => \thebuggenie\core\entities\common\Timeable::formatTimeableLog($log_action['text'], $log_action['previous_value'], $log_action['current_value'], true, true))) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_TIME_SPENT:
     echo '<i>' . __('Time spent: %text', array('%text' => \thebuggenie\core\entities\common\Timeable::formatTimeableLog($log_action['text'], $log_action['previous_value'], $log_action['current_value'], true, true))) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_ASSIGNED:
     echo '<i>' . __('Assignee changed: %text', array('%text' => $log_action['text'])) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_OWNED:
     echo '<i>' . __('Owner changed: %text', array('%text' => $log_action['text'])) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_POSTED:
     echo '<i>' . __('Posted by changed: %text', array('%text' => $log_action['text'])) . '</i>';
     break;
 default:
     if (empty($log_action['text'])) {
         echo '<i>' . __('Issue updated') . '</i>';
     } else {
         echo '<i>' . $log_action['text'] . '</i>';
     echo '<i>' . __('Resolution changed: %text', array('%text' => $item->getText())) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_PERCENT:
     echo '<i>' . __('Percent completed: %text', array('%text' => $item->getText())) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_MILESTONE:
     echo '<i>' . __('Target milestone changed: %text', array('%text' => $item->getText())) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_ISSUETYPE:
     echo '<i>' . __('Issue type changed: %text', array('%text' => $item->getText())) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_TIME_ESTIMATED:
     echo '<i>' . __('Estimation changed: %text', array('%text' => \thebuggenie\core\entities\common\Timeable::formatTimeableLog($item->getText(), $item->getPreviousValue(), $item->getCurrentValue(), true, true))) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_TIME_SPENT:
     echo '<i>' . __('Time spent: %text', array('%text' => \thebuggenie\core\entities\common\Timeable::formatTimeableLog($item->getText(), $item->getPreviousValue(), $item->getCurrentValue(), true, true))) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_ASSIGNED:
     echo '<i>' . __('Assignee changed: %text', array('%text' => $item->getText())) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_OWNED:
     echo '<i>' . __('Owner changed: %text', array('%text' => $item->getText())) . '</i>';
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_POSTED:
     echo '<i>' . __('Posted by changed: %text', array('%text' => $item->getText())) . '</i>';
     break;
 default:
     if (!$item->getText()) {
         echo '<i>' . __('Issue updated') . '</i>';
     } else {
         echo '<i>' . $item->getText() . '</i>';
 public function editOrAdd(Issue $issue, User $user, $data = array())
 {
     if (!$this->getID()) {
         if ($data['timespent_manual']) {
             $times = Issue::convertFancyStringToTime($data['timespent_manual'], $issue);
         } else {
             $times = \thebuggenie\core\entities\common\Timeable::getZeroedUnitsWithPoints();
             $times[$data['timespent_specified_type']] = $data['timespent_specified_value'];
         }
         $this->setIssue($issue);
         $this->setUser($user);
     } else {
         $times = array('points' => $data['points'], 'minutes' => $data['minutes'], 'hours' => $data['hours'], 'days' => $data['days'], 'weeks' => $data['weeks'], 'months' => $data['months']);
         $edited_at = $data['edited_at'];
         $this->setEditedAt(mktime(0, 0, 1, $edited_at['month'], $edited_at['day'], $edited_at['year']));
     }
     $times['hours'] *= 100;
     $this->setSpentPoints($times['points']);
     $this->setSpentMinutes($times['minutes']);
     $this->setSpentHours($times['hours']);
     $this->setSpentDays($times['days']);
     $this->setSpentWeeks($times['weeks']);
     $this->setSpentMonths($times['months']);
     $this->setActivityType($data['timespent_activitytype']);
     $this->setComment($data['timespent_comment']);
     $this->save();
     $this->getIssue()->saveSpentTime();
 }
     echo ' * ' . __('Resolution changed: %text', array('%text' => str_replace('&rArr;', '->', $item->getText())));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_PERCENT:
     echo ' * ' . __('Percent completed: %text', array('%text' => str_replace('&rArr;', '->', $item->getText())));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_MILESTONE:
     echo ' * ' . __('Target milestone changed: %text', array('%text' => str_replace('&rArr;', '->', $item->getText())));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_ISSUETYPE:
     echo ' * ' . __('Issue type changed: %text', array('%text' => str_replace('&rArr;', '->', $item->getText())));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_TIME_ESTIMATED:
     echo ' * ' . __('Estimation changed: %text', array('%text' => str_replace('&rArr;', '->', \thebuggenie\core\entities\common\Timeable::formatTimeableLog($item->getText(), $item->getPreviousValue(), $item->getCurrentValue(), true, true))));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_TIME_SPENT:
     echo ' * ' . __('Time spent: %text', array('%text' => str_replace('&rArr;', '->', \thebuggenie\core\entities\common\Timeable::formatTimeableLog($item->getText(), $item->getPreviousValue(), $item->getCurrentValue(), true, true))));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_ASSIGNED:
     echo ' * ' . __('Assignee changed: %text', array('%text' => $item->getText()));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_OWNED:
     echo ' * ' . __('Owner changed: %text', array('%text' => $item->getText()));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_POSTED:
     echo ' * ' . __('Posted by changed: %text', array('%text' => str_replace('&rArr;', '->', $item->getText())));
     break;
 default:
     if (!$item->getText()) {
         echo ' * ' . __('Issue updated');
     } else {
         echo ' * ' . $item->getText();
Beispiel #9
0
 public function runIssueEditTimeSpent(framework\Request $request)
 {
     $entry_id = $request['entry_id'];
     $spenttime = $entry_id ? tables\IssueSpentTimes::getTable()->selectById($entry_id) : new entities\IssueSpentTime();
     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');
     }
     framework\Context::loadLibrary('common');
     $spenttime->editOrAdd($issue, $this->getUser(), array_only_with_default($request->getParameters(), array_merge(array('timespent_manual', 'timespent_specified_type', 'timespent_specified_value', 'timespent_activitytype', 'timespent_comment', 'edited_at'), \thebuggenie\core\entities\common\Timeable::getUnitsWithPoints())));
     return $this->renderJSON(array('edited' => 'ok', 'issue_id' => $issue_id, 'timesum' => array_sum($spenttime->getIssue()->getSpentTime()), 'spenttime' => entities\Issue::getFormattedTime($spenttime->getIssue()->getSpentTime(true, true)), 'percentbar' => $this->getComponentHTML('main/percentbar', array('percent' => $issue->getEstimatedPercentCompleted(), 'height' => 3)), 'timeentries' => $this->getComponentHTML('main/issuespenttimes', array('issue' => $spenttime->getIssue()))));
 }
Beispiel #10
0
 public function calculateTimeSpent()
 {
     $ts_array = array_fill_keys(common\Timeable::getUnitsWithout(array('months')), 0);
     $time_spent = $this->_being_worked_on_by_user_since ? NOW - $this->_being_worked_on_by_user_since : 0;
     if ($time_spent > 0) {
         $weeks_spent = floor($time_spent / 604800);
         $days_spent = floor(($time_spent - $weeks_spent * 604800) / 86400);
         $hours_spent = floor(($time_spent - $weeks_spent * 604800 - $days_spent * 86400) / 3600);
         $minutes_spent = ceil(($time_spent - $weeks_spent * 604800 - $days_spent * 86400 - $hours_spent * 3600) / 60);
         if ($this->getProject()->hasTimeUnit('minutes')) {
             $ts_array['minutes'] = $minutes_spent < 0 ? 0 : $minutes_spent;
         }
         if ($this->getProject()->hasTimeUnit('hours')) {
             $ts_array['hours'] = $hours_spent < 0 ? 0 : $hours_spent;
         }
         if ($this->getProject()->hasTimeUnit('days')) {
             $ts_array['days'] = $days_spent < 0 ? 0 : $days_spent;
         }
         if ($this->getProject()->hasTimeUnit('weeks')) {
             $ts_array['weeks'] = $weeks_spent < 0 ? 0 : $weeks_spent;
         }
     }
     return $ts_array;
 }
 public function perform(\thebuggenie\core\entities\Issue $issue, $request = null)
 {
     switch ($this->_action_type) {
         case self::ACTION_ASSIGN_ISSUE_SELF:
             $issue->setAssignee(framework\Context::getUser());
             break;
         case self::ACTION_SET_STATUS:
             if ($this->getTargetValue()) {
                 $issue->setStatus(Status::getB2DBTable()->selectById((int) $this->getTargetValue()));
             } else {
                 $issue->setStatus($request['status_id']);
             }
             break;
         case self::ACTION_CLEAR_MILESTONE:
             $issue->setMilestone(null);
             break;
         case self::ACTION_SET_MILESTONE:
             if ($this->getTargetValue()) {
                 $issue->setMilestone(Milestone::getB2DBTable()->selectById((int) $this->getTargetValue()));
             } else {
                 $issue->setMilestone($request['milestone_id']);
             }
             break;
         case self::ACTION_CLEAR_PRIORITY:
             $issue->setPriority(null);
             break;
         case self::ACTION_SET_PRIORITY:
             if ($this->getTargetValue()) {
                 $issue->setPriority(Priority::getB2DBTable()->selectById((int) $this->getTargetValue()));
             } else {
                 $issue->setPriority($request['priority_id']);
             }
             break;
         case self::ACTION_CLEAR_PERCENT:
             $issue->setPercentCompleted(0);
             break;
         case self::ACTION_SET_PERCENT:
             if ($this->getTargetValue()) {
                 $issue->setPercentCompleted((int) $this->getTargetValue());
             } else {
                 $issue->setPercentCompleted((int) $request['percent_complete_id']);
             }
             break;
         case self::ACTION_CLEAR_DUPLICATE:
             $issue->setDuplicateOf(null);
             break;
         case self::ACTION_SET_DUPLICATE:
             $issue->setDuplicateOf($request['duplicate_issue_id']);
             break;
         case self::ACTION_CLEAR_RESOLUTION:
             $issue->setResolution(null);
             break;
         case self::ACTION_SET_RESOLUTION:
             if ($this->getTargetValue()) {
                 $issue->setResolution(Resolution::getB2DBTable()->selectById((int) $this->getTargetValue()));
             } else {
                 $issue->setResolution($request['resolution_id']);
             }
             break;
         case self::ACTION_CLEAR_REPRODUCABILITY:
             $issue->setReproducability(null);
             break;
         case self::ACTION_SET_REPRODUCABILITY:
             if ($this->getTargetValue()) {
                 $issue->setReproducability(Reproducability::getB2DBTable()->selectById((int) $this->getTargetValue()));
             } else {
                 $issue->setReproducability($request['reproducability_id']);
             }
             break;
         case self::ACTION_CLEAR_ASSIGNEE:
             $issue->clearAssignee();
             break;
         case self::ACTION_ASSIGN_ISSUE:
             if ($this->getTargetValue()) {
                 $target_details = explode('_', $this->_target_value);
                 if ($target_details[0] == 'user') {
                     $assignee = \thebuggenie\core\entities\User::getB2DBTable()->selectById((int) $target_details[1]);
                 } else {
                     $assignee = Team::getB2DBTable()->selectById((int) $target_details[1]);
                 }
                 $issue->setAssignee($assignee);
             } else {
                 $assignee = null;
                 switch ($request['assignee_type']) {
                     case 'user':
                         $assignee = \thebuggenie\core\entities\User::getB2DBTable()->selectById((int) $request['assignee_id']);
                         break;
                     case 'team':
                         $assignee = Team::getB2DBTable()->selectById((int) $request['assignee_id']);
                         break;
                 }
                 if ((bool) $request->getParameter('assignee_teamup', false) && $assignee instanceof \thebuggenie\core\entities\User && $assignee->getID() != framework\Context::getUser()->getID()) {
                     $team = new \thebuggenie\core\entities\Team();
                     $team->setName($assignee->getBuddyname() . ' & ' . framework\Context::getUser()->getBuddyname());
                     $team->setOndemand(true);
                     $team->save();
                     $team->addMember($assignee);
                     $team->addMember(framework\Context::getUser());
                     $assignee = $team;
                 }
                 $issue->setAssignee($assignee);
             }
             break;
         case self::ACTION_USER_START_WORKING:
             $issue->clearUserWorkingOnIssue();
             if ($issue->getAssignee() instanceof \thebuggenie\core\entities\Team && $issue->getAssignee()->isOndemand()) {
                 $members = $issue->getAssignee()->getMembers();
                 $issue->startWorkingOnIssue(array_shift($members));
             } elseif ($issue->getAssignee() instanceof \thebuggenie\core\entities\User) {
                 $issue->startWorkingOnIssue($issue->getAssignee());
             }
             break;
         case self::ACTION_USER_STOP_WORKING:
             if ($request->getParameter('did', 'nothing') == 'nothing') {
                 $issue->clearUserWorkingOnIssue();
             } elseif ($request->getParameter('did', 'nothing') == 'this') {
                 $times = array();
                 if ($request['timespent_manual']) {
                     $times = Issue::convertFancyStringToTime($request['timespent_manual'], $issue);
                 } elseif ($request['timespent_specified_type']) {
                     $times = \thebuggenie\core\entities\common\Timeable::getZeroedUnitsWithPoints();
                     $times[$request['timespent_specified_type']] = $request['timespent_specified_value'];
                 }
                 if (array_sum($times) > 0) {
                     $times['hours'] *= 100;
                     $spenttime = new \thebuggenie\core\entities\IssueSpentTime();
                     $spenttime->setIssue($issue);
                     $spenttime->setUser(framework\Context::getUser());
                     $spenttime->setSpentPoints($times['points']);
                     $spenttime->setSpentMinutes($times['minutes']);
                     $spenttime->setSpentHours($times['hours']);
                     $spenttime->setSpentDays($times['days']);
                     $spenttime->setSpentWeeks($times['weeks']);
                     $spenttime->setSpentMonths($times['months']);
                     $spenttime->setActivityType($request['timespent_activitytype']);
                     $spenttime->setComment($request['timespent_comment']);
                     $spenttime->save();
                 }
                 $issue->clearUserWorkingOnIssue();
             } else {
                 $issue->stopWorkingOnIssue(framework\Context::getUser(), $request['timespent_activitytype'], $request['timespent_comment']);
             }
             break;
         default:
             if (strpos($this->_action_type, self::CUSTOMFIELD_CLEAR_PREFIX) === 0) {
                 $customkey = substr($this->_action_type, strlen(self::CUSTOMFIELD_CLEAR_PREFIX));
                 $issue->setCustomField($customkey, null);
             } elseif (strpos($this->_action_type, self::CUSTOMFIELD_SET_PREFIX) === 0) {
                 $customkey = substr($this->_action_type, strlen(self::CUSTOMFIELD_SET_PREFIX));
                 if ($this->getTargetValue()) {
                     $issue->setCustomField($customkey, $this->getTargetValue());
                 } else {
                     $issue->setCustomField($customkey, $request[$customkey . '_id']);
                 }
             } else {
                 $event = new \thebuggenie\core\framework\Event('core', 'WorkflowTransitionAction::perform', $issue, array('request' => $request));
                 $event->triggerUntilProcessed();
             }
     }
 }
     if ($item->hasChangeDetails()) {
         echo __("Percent complete changed: %previous_value => %new_value", array('%previous_value' => '<strong>' . (int) $item->getPreviousValue() . '</strong>', '%new_value' => '<strong>' . (int) $item->getCurrentValue() . '</strong>'));
     }
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_BLOCKED:
     echo image_tag('icon_locked.png');
     echo __('Blocking status changed: %value', array('%value' => '<strong>' . __('This issue is blocking the next release') . '</strong>'));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_UNBLOCKED:
     echo image_tag('icon_unlocked.png');
     echo __('Blocking status changed: %value', array('%value' => '<strong>' . __('This issue is no more blocking the next release') . '</strong>'));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_TIME_ESTIMATED:
     echo image_tag('icon_estimated_time.png');
     if ($item->hasChangeDetails()) {
         echo __("Estimated time changed: %value", array('%value' => '<strong>' . \thebuggenie\core\entities\common\Timeable::formatTimeableLog($item->getText(), $item->getPreviousValue(), $item->getCurrentValue(), true, true) . '</strong>'));
     }
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_AFF_ADD:
     echo image_tag('icon_affected_items.png');
     if ($item->hasChangeDetails()) {
         echo __("Affected item added: %value", array('%value' => '<strong>' . $item->getText() . '</strong>'));
     }
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_AFF_UPDATE:
     echo image_tag('icon_affected_items.png');
     if ($item->hasChangeDetails()) {
         echo __("Affected item updated: %value", array('%value' => '<strong>' . $item->getText() . '</strong>'));
     }
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_AFF_DELETE:
Beispiel #13
0
     echo __('Resolution changed: %text', array('%text' => $activity['text']));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_PERCENT:
     echo __('Percent completed: %text', array('%text' => $activity['text']));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_MILESTONE:
     echo __('Target milestone changed: %text', array('%text' => $activity['text']));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_ISSUETYPE:
     echo __('Issue type changed: %text', array('%text' => $activity['text']));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_TIME_ESTIMATED:
     echo __('Estimation changed: %text', array('%text' => \thebuggenie\core\entities\common\Timeable::formatTimeableLog($activity['text'], $activity['previous_value'], $activity['current_value'], true, true)));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_TIME_SPENT:
     echo __('Time spent: %text', array('%text' => \thebuggenie\core\entities\common\Timeable::formatTimeableLog($activity['text'], $activity['previous_value'], $activity['current_value'], true, true)));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_ASSIGNED:
     echo __('Assignee changed: %text', array('%text' => $activity['text']));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_OWNED:
     echo __('Owner changed: %text', array('%text' => $activity['text']));
     break;
 case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_POSTED:
     echo __('Posted by changed: %text', array('%text' => $activity['text']));
     break;
 default:
     if (empty($activity['text'])) {
         echo __('Issue updated');
     } else {
         echo $activity['text'];