<?php

if (count($comments)) {
    ?>
	<table cellpadding=0 cellspacing=0 style="margin: 5px;">
		<?php 
    $prev_date = null;
    ?>
		<?php 
    foreach ($comments as $comment) {
        ?>
			<?php 
        $date = tbg_formatTime($comment->getPosted(), 5);
        ?>
			<?php 
        if ($date != $prev_date) {
            ?>
				<tr>
					<td class="latest_action_dates" colspan="2"><?php 
            echo $date;
            ?>
</td>
				</tr>
			<?php 
        }
        ?>
			<?php 
        include_component('main/commentitem', array('comment' => $comment, 'include_project' => true));
        ?>
			<?php 
        $prev_date = $date;
    ?>
			<ul class="article_list">
				<?php 
    foreach ($latest_articles as $article) {
        ?>
					<li>
						<div>
							<?php 
        echo image_tag('news_item_medium.png', array('style' => 'float: left;'), false, 'publish');
        ?>
							<?php 
        echo link_tag(make_url('publish_article', array('article_name' => $article->getName())), get_spaced_name($article->getTitle()));
        ?>
							<br>
							<span><?php 
        echo __('%time, by %user', array('%time' => tbg_formatTime($article->getPostedDate(), 3), '%user' => '<b>' . ($article->getAuthor() instanceof TBGIdentifiable ? '<a href="javascript:void(0);" onclick="TBG.Main.Helpers.Backdrop.show(\'' . make_url('get_partial_for_backdrop', array('key' => 'usercard', 'user_id' => $article->getAuthor()->getID())) . '\');">' . $article->getAuthor()->getName() . '</a>' : __('System')) . '</b>'));
        ?>
</span>
						</div>
					</li>
				<?php 
    }
    ?>
			</ul>
		<?php 
} else {
    ?>
			<div class="no_items"><?php 
    echo __('There are no recent pages here');
    ?>
</div>
    ?>
</option>
											<?php 
}
?>
										</select>
									</td>
								</tr>
								<tr>
									<td class="config_explanation" colspan="2">
										<?php 
echo __('This setting is used to display issues, comments and more in your local timezone.');
?>
<br>
 										<?php 
echo __('The time is now: %time%', array('%time%' => tbg_formatTime(time(), 1)));
?>
									</td>
								</tr>
								<tr>
									<td style="width: 200px; padding: 5px;"><label for="profile_timezone"><?php 
echo __('Language');
?>
</label></td>
									<td>
										<select name="profile_language" id="profile_language" style="width: 300px;">
											<option value="sys"<?php 
if ($tbg_user->getLanguage() == 'sys') {
    ?>
 selected<?php 
}
 - <?php 
        echo tbg_formatTime($milestone->getScheduledDate(), 22, true, true);
        ?>
)
            <?php 
    } elseif ($milestone->getStartingDate() && !$milestone->isScheduled()) {
        ?>
                (<?php 
        echo __('Starting %start_date', array('%start_date' => tbg_formatTime($milestone->getStartingDate(), 22, true, true)));
        ?>
)
            <?php 
    } elseif (!$milestone->getStartingDate() && $milestone->isScheduled()) {
        ?>
                (<?php 
        echo __('Ends %end_date', array('%end_date' => tbg_formatTime($milestone->getScheduledDate(), 22, true, true)));
        ?>
)
            <?php 
    }
    ?>
        </span>
        <div id="selected_burndown_image" class="graph_view" style="margin: 15px; width: 750px; height: 360px;"></div>
        <?php 
    //echo image_tag(make_url('project_scrum_sprint_burndown_image', array('project_key' => $selected_project->getKey(), 'sprint_id' => $milestone->getID())), array('style' => 'margin: 15px 0 15px 0;', 'id' => 'selected_burndown_image'), true);
    ?>
        <table id="milestone_details_issue_list" cellpadding="0" cellspacing="0" border="0">
            <thead>
                <tr>
                    <th>&nbsp;</td>
                    <th><?php 
        ?>
</td>
				<td>
					<span class="faded_out smaller"><?php 
        echo link_tag(make_url('project_dashboard', array('project_key' => $theIssue->getProject()->getKey())), '[' . $theIssue->getProject()->getKey() . ']');
        ?>
</span>
					<?php 
        echo link_tag(make_url('viewissue', array('project_key' => $theIssue->getProject()->getKey(), 'issue_no' => $theIssue->getFormattedIssueNo())), $theIssue->getFormattedTitle(true));
        ?>
				</td>
			</tr>
			<tr>
				<td colspan="2" class="faded_out" style="padding-bottom: 15px;">
					<?php 
        echo __('<strong>%status%</strong>, updated %updated_at%', array('%status%' => $theIssue->getStatus() instanceof TBGDatatype ? $theIssue->getStatus()->getName() : __('Status not determined'), '%updated_at%' => tbg_formatTime($theIssue->getLastUpdatedTime(), 12)));
        ?>
				</td>
			</tr>
		<?php 
    }
    ?>
		</table>
	<?php 
} else {
    ?>
		<div class="faded_out" style="padding: 5px 5px 15px 5px;"><?php 
    echo __($default_message);
    ?>
</div>
	<?php 
 public function do_execute()
 {
     $this->cliEcho('Showing detailed information about ');
     $this->cliEcho($this->getProvidedArgument('project_key'), 'green');
     $this->cliEcho(' issue ');
     $print_issue_number = $this->getProvidedArgument('issue_number');
     if (is_numeric($print_issue_number)) {
         $print_issue_number = '#' . $print_issue_number;
     }
     $this->cliEcho($print_issue_number, 'yellow');
     $this->cliEcho(' on ');
     $this->cliEcho($this->_getCurrentRemoteServer(), 'white', 'bold');
     $this->cliEcho("\n");
     $url_options = array('project_key' => $this->project_key, 'issue_no' => $this->issue_number, 'format' => 'json');
     $this->cliEcho("\n");
     $issue = $this->getRemoteResponse($this->getRemoteURL('api_viewissue', $url_options));
     \thebuggenie\core\framework\Context::loadLibrary('common');
     $this->cliEcho($print_issue_number, 'green', 'bold');
     $this->cliEcho(" - ");
     $state = $issue->state == \thebuggenie\core\entities\Issue::STATE_OPEN ? 'OPEN' : 'CLOSED';
     $this->cliEcho("[{$state}] ", 'cyan');
     $this->cliEcho(html_entity_decode($issue->title), 'white', 'bold');
     $this->cliEcho("\n");
     $this->cliEcho("State: ", 'white', 'bold');
     $this->cliEcho($state);
     $this->cliEcho("\n");
     $this->cliEcho("Posted: ", 'white', 'bold');
     $this->cliEcho(tbg_formatTime($issue->created_at, 21, true, true) . ' (' . $issue->created_at . ')');
     $this->cliEcho("\n");
     $this->cliEcho("Posted by: ", 'white', 'bold');
     if ($issue->posted_by) {
         $this->cliEcho($issue->posted_by->name);
     } else {
         $this->cliEcho('-');
     }
     $this->cliEcho("\n");
     $this->cliEcho("Updated: ", 'white', 'bold');
     $this->cliEcho(tbg_formatTime($issue->updated_at, 21, true, true) . ' (' . $issue->updated_at . ')');
     $this->cliEcho("\n");
     $this->cliEcho("Assigned to: ", 'white', 'bold');
     if ($issue->assignee) {
         $this->cliEcho($issue->assignee->name);
     } else {
         $this->cliEcho('-');
     }
     $this->cliEcho("\n");
     $this->cliEcho("Status: ", 'white', 'bold');
     if ($issue->status) {
         $this->cliEcho($issue->status->name);
     } else {
         $this->cliEcho('-');
     }
     $this->cliEcho("\n");
     foreach ($issue->visible_fields as $field => $details) {
         $name = ucfirst(str_replace('_', ' ', $field));
         $this->cliEcho("{$name}: ", 'white', 'bold');
         if (isset($issue->{$field})) {
             if ($field == 'estimated_time' || $field == 'spent_time') {
                 if (isset($issue->{$field}->points)) {
                     $this->cliEcho($issue->{$field}->points . 'p, ' . $issue->{$field}->hours . 'h, ' . $issue->{$field}->days . 'd, ' . $issue->{$field}->weeks . 'w, ' . $issue->{$field}->months . 'mo');
                 } else {
                     $this->cliEcho('-');
                 }
             } else {
                 if (is_object($issue->{$field})) {
                     $this->cliEcho($issue->{$field}->name);
                 } else {
                     $this->cliEcho($issue->{$field});
                 }
             }
         } else {
             $this->cliEcho('-');
         }
         $this->cliEcho("\n");
     }
     if ($this->getProvidedArgument('include_comments', 'no') == 'yes') {
         $this->cliEcho("\n");
         $this->cliEcho("Comments: \n", 'white', 'bold');
         if (count($issue->comments) > 0) {
             foreach ($issue->comments as $comment) {
                 if ($comment->system_comment && $this->getProvidedArgument('include_system_comments', 'no') != 'yes') {
                     continue;
                 }
                 $this->cliEcho('Comment #' . $comment->comment_number, 'yellow', 'bold');
                 $this->cliEcho("\n");
                 $this->cliEcho('Posted by: ', 'white', 'bold');
                 if ($comment->posted_by) {
                     $this->cliEcho($comment->posted_by->name);
                 } else {
                     $this->cliEcho("Unknown user");
                 }
                 $this->cliEcho("\n");
                 $this->cliEcho('Posted: ', 'white', 'bold');
                 $this->cliEcho(tbg_formatTime($comment->created_at, 21, true, true) . ' (' . $comment->created_at . ')');
                 $this->cliEcho("\n");
                 $this->cliEcho('Comment: ', 'white', 'bold');
                 $this->cliEcho($comment->content);
                 $this->cliEcho("\n");
                 $this->cliEcho('----------', 'white', 'bold');
                 $this->cliEcho("\n\n");
             }
         } else {
             $this->cliEcho('There are no comments');
         }
     }
     $this->cliEcho("\n\n");
 }
            ?>
"><?php 
            echo image_tag($issue->getIssueType()->getIcon() . '_tiny.png', array('class' => 'informal'));
            ?>
<div><?php 
            echo __('Issue %issue_no - %title', array('%issue_no' => $issue->getFormattedIssueNo(true), '%title' => mb_strlen($issue->getTitle()) <= 32 ? $issue->getTitle() : str_pad(mb_substr($issue->getTitle(), 0, 32), 35, '...')));
            ?>
</div><span class="informal"><?php 
            if ($issue->isClosed()) {
                ?>
[<?php 
                echo mb_strtoupper(__('Closed'));
                ?>
] <?php 
            }
            echo __('Last updated %updated_at', array('%updated_at' => tbg_formatTime($issue->getLastUpdatedTime(), 6)));
            ?>
</span><span class="informal url"><?php 
            echo make_url('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo()));
            ?>
</span><div class="informal extra"><?php 
            echo __('Status: %status', array('%status' => '<span>' . $issue->getStatus()->getName() . '</span>'));
            ?>
</div><?php 
            if ($issue->isResolutionVisible()) {
                ?>
<div class="informal extra"><?php 
                echo __('Resolution: %resolution', array('%resolution' => '<span>' . ($issue->getResolution() instanceof \thebuggenie\core\entities\Resolution ? $issue->getResolution()->getName() : '<span class="faded_out">' . __('Not determined') . '</span>') . '</span>'));
                ?>
</div><?php 
            }
Example #8
0
 public function getDateString()
 {
     framework\Context::loadLibrary('common');
     $i18n = framework\Context::getI18n();
     if ($this->hasStartingDate() && $this->hasScheduledDate()) {
         if ($this->getStartingDate() < NOW && $this->getScheduledDate() < NOW) {
             return $i18n->__('%milestone_name (started %start_date - ended %end_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true), '%end_date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
         } elseif ($this->getStartingDate() < NOW && $this->getScheduledDate() > NOW) {
             return $i18n->__('%milestone_name (started %start_date - ends %end_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true), '%end_date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
         } elseif ($this->getStartingDate() > NOW) {
             return $i18n->__('%milestone_name (starts %start_date - ended %end_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true), '%end_date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
         }
     } elseif ($this->hasStartingDate()) {
         if ($this->getStartingDate() < NOW) {
             return $i18n->__('%milestone_name (started %start_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true)));
         } else {
             return $i18n->__('%milestone_name (starts %start_date)', array('%milestone_name' => '', '%start_date' => tbg_formatTime($this->getStartingDate(), 23, true, true)));
         }
     } elseif ($this->hasScheduledDate()) {
         if ($this->getScheduledDate() < NOW) {
             return $i18n->__('%milestone_name (released: %date)', array('%milestone_name' => '', '%date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
         } else {
             return $i18n->__('%milestone_name (will be released: %date)', array('%milestone_name' => '', '%date' => tbg_formatTime($this->getScheduledDate(), 23, true, true)));
         }
     } elseif ($this->hasReachedDate()) {
         return $i18n->__('%milestone_name (reached: %date)', array('%milestone_name' => '', '%date' => tbg_formatTime($this->getReachedDate(), 23, true, true)));
     }
     return $i18n->__('Not scheduled');
 }
 $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:
         case \thebuggenie\core\entities\CustomDatatype::EDITIONS_CHOICE:
         case \thebuggenie\core\entities\CustomDatatype::MILESTONE_CHOICE:
         case \thebuggenie\core\entities\CustomDatatype::RELEASES_CHOICE:
         case \thebuggenie\core\entities\CustomDatatype::STATUS_CHOICE:
         case \thebuggenie\core\entities\CustomDatatype::TEAM_CHOICE:
         case \thebuggenie\core\entities\CustomDatatype::USER_CHOICE:
             $value = $value instanceof \thebuggenie\core\entities\common\Identifiable ? $value->getName() : '';
             break;
Example #10
0
 /**
  * Check incoming email accounts for incoming emails
  *
  * @Route(url="/mailing/incoming_account/:account_id/check", name="check_account")
  * @param \thebuggenie\core\framework\Request $request
  * @return type
  * @throws \Exception
  */
 public function runCheckIncomingAccount(framework\Request $request)
 {
     framework\Context::loadLibrary('common');
     if ($account_id = $request['account_id']) {
         try {
             $account = new \thebuggenie\modules\mailing\entities\IncomingEmailAccount($account_id);
             try {
                 if (!function_exists('imap_open')) {
                     throw new \Exception($this->getI18n()->__('The php imap extension is not installed'));
                 }
                 framework\Context::getModule('mailing')->processIncomingEmailAccount($account);
             } catch (\Exception $e) {
                 $this->getResponse()->setHttpStatus(400);
                 return $this->renderJSON(array('error' => $e->getMessage()));
             }
             return $this->renderJSON(array('account_id' => $account->getID(), 'time' => tbg_formatTime($account->getTimeLastFetched(), 6), 'count' => $account->getNumberOfEmailsLastFetched()));
         } catch (\Exception $e) {
             $this->getResponse()->setHttpStatus(400);
             return $this->renderJSON(array('error' => $this->getI18n()->__('This is not a valid mailing account')));
         }
     } else {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('error' => $this->getI18n()->__('This is not a valid mailing account')));
     }
 }
Example #11
0
        </td>
        <td style="clear: both;<?php 
    if (!isset($include_issue_title) || $include_issue_title) {
        ?>
 padding-bottom: <?php 
        echo isset($extra_padding) && $extra_padding ? 15 : 10;
        ?>
px;<?php 
    }
    ?>
">
            <?php 
    if ((!isset($include_issue_title) || $include_issue_title) && (isset($include_time) && $include_time == true)) {
        ?>
<span class="time "><?php 
        echo tbg_formatTime($log_action['timestamp'], 19);
        ?>
</span>&nbsp;<?php 
    }
    ?>
            <?php 
    if (!isset($include_issue_title) || $include_issue_title) {
        ?>
                <?php 
        if (isset($include_project) && $include_project == true) {
            ?>
<span class="faded_out smaller"><?php 
            echo image_tag($issue->getProject()->getSmallIconName(), array('class' => 'issuelog-project-logo'), $issue->getProject()->hasSmallIcon());
            ?>
</span><?php 
        }
<?php

if ($item instanceof \thebuggenie\core\entities\LogItem) {
    ?>
    <li>
        <span class="date"><?php 
    echo date('YmdHis', $previous_time) != date('YmdHis', $item->getTime()) ? tbg_formatTime($item->getTime(), 6) : '';
    ?>
</span>&nbsp;
        <?php 
    $previous_value = null;
    $new_value = null;
    try {
        switch ($item->getChangeType()) {
            case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_CREATED:
                echo image_tag('icon_open_new.png');
                echo __('The issue was created');
                break;
            case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_CLOSE:
                echo image_tag('icon_close.png');
                echo __('The issue was closed');
                break;
            case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_REOPEN:
                echo image_tag('icon_open_new.png');
                echo __('The issue was reopened');
                break;
            case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_DEPENDS:
                echo image_tag('icon_new_related_issue.png');
                echo __('The issues dependency changed: %change', array('%change' => '<strong>' . $item->getText() . '</strong>'));
                break;
            case \thebuggenie\core\entities\tables\Log::LOG_ISSUE_UPDATE:
Example #13
0
 public function runTransitionIssues(TBGRequest $request)
 {
     try {
         try {
             $transition = TBGContext::factory()->TBGWorkflowTransition($request['transition_id']);
         } catch (Exception $e) {
             $this->getResponse()->setHttpStatus(400);
             return $this->renderJSON(array('error' => $this->getI18n()->__('This is not a valid transition')));
         }
         $issue_ids = $request['issue_ids'];
         $status = null;
         $closed = false;
         foreach ($issue_ids as $issue_id) {
             $issue = TBGContext::factory()->TBGIssue($issue_id);
             if (!$issue->isWorkflowTransitionsAvailable() || !$transition->validateFromRequest($request)) {
                 $this->getResponse()->setHttpStatus(400);
                 return $this->renderJSON(array('error' => TBGContext::getI18n()->__('The transition could not be applied to issue %issue_number because of %errors', array('%issue_number' => $issue->getFormattedIssueNo(), '%errors' => join(', ', $transition->getValidationErrors())))));
             }
             try {
                 $transition->transitionIssueToOutgoingStepFromRequest($issue, $request);
             } catch (Exception $e) {
                 $this->getResponse()->setHttpStatus(400);
                 TBGLogging::log(TBGLogging::LEVEL_WARNING, 'Transition ' . $transition->getID() . ' failed for issue ' . $issue_id);
                 TBGLogging::log(TBGLogging::LEVEL_WARNING, $e->getMessage());
                 return $this->renderJSON(array('error' => $this->getI18n()->__('The transition failed because of an error in the workflow. Check your workflow configuration.')));
             }
             if ($status === null) {
                 $status = $issue->getStatus();
             }
             $closed = $issue->isClosed();
         }
         TBGContext::loadLibrary('common');
         $options = array('issue_ids' => array_keys($issue_ids), 'last_updated' => tbg_formatTime(time(), 20), 'closed' => $closed);
         $options['status'] = array('color' => $status->getColor(), 'name' => $status->getName(), 'id' => $status->getID());
         if ($request->hasParameter('milestone_id')) {
             $milestone = new TBGMilestone($request['milestone_id']);
             $options['milestone_id'] = $milestone->getID();
             $options['milestone_name'] = $milestone->getName();
         }
         foreach (array('resolution', 'priority', 'category', 'severity') as $item) {
             $class = "TBG" . ucfirst($item);
             if ($request->hasParameter($item . '_id')) {
                 if ($item_id = $request[$item . '_id']) {
                     $itemobject = new $class($item_id);
                     $itemname = $itemobject->getName();
                 } else {
                     $item_id = 0;
                     $itemname = '-';
                 }
                 $options[$item] = array('name' => $itemname, 'id' => $item_id);
             } else {
                 $method = 'get' . ucfirst($item);
                 $itemname = $issue->{$method}() instanceof $class ? $issue->{$method}()->getName() : '-';
                 $item_id = $issue->{$method}() instanceof $class ? $issue->{$method}()->getID() : 0;
                 $options[$item] = array('name' => $itemname, 'id' => $item_id);
             }
         }
         return $this->renderJSON($options);
     } catch (Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         TBGLogging::log(TBGLogging::LEVEL_WARNING, 'Transition ' . $transition->getID() . ' failed for issue ' . $issue_id);
         TBGLogging::log(TBGLogging::LEVEL_WARNING, $e->getMessage());
         return $this->renderJSON(array('error' => $this->getI18n()->__('An error occured when trying to apply the transition')));
     }
 }
if ($milestone->getStartingDate()) {
    ?>
            <?php 
    echo tbg_formatTime($milestone->getStartingDate(), 20, true, true) . ' - ';
    if ($milestone->getScheduledDate() > 0) {
        echo tbg_formatTime($milestone->getScheduledDate(), 20, true, true);
    } else {
        echo __('No scheduled date specified');
    }
    ?>
        <?php 
} else {
    ?>
            <?php 
    if ($milestone->getScheduledDate() > 0) {
        echo __('Scheduled for %scheduled_date', array('%scheduled_date' => tbg_formatTime($milestone->getScheduledDate(), 20, true, true)));
    } else {
        echo __('No scheduled date specified');
    }
    ?>
        <?php 
}
?>
    </div>
    <div class="percentage">
        <div class="numbers">
            <?php 
if ($milestone->isSprint()) {
    ?>
                <?php 
    if ($milestone->countClosedIssues() == 1) {
        if ($issue->getUserWorkingOnIssue()->getID() == $tbg_user->getID()) {
            ?>
                            <?php 
            echo __('You have been working on this issue since %time', array('%time' => tbg_formatTime($issue->getWorkedOnSince(), 6)));
            ?>
                        <?php 
        } elseif ($issue->getAssignee() instanceof \thebuggenie\core\entities\Team) {
            ?>
                            <?php 
            echo __('%teamname has been working on this issue since %time', array('%teamname' => $issue->getAssignee()->getName(), '%time' => tbg_formatTime($issue->getWorkedOnSince(), 6)));
            ?>
                        <?php 
        } else {
            ?>
                            <?php 
            echo __('%user has been working on this issue since %time', array('%user' => $issue->getUserWorkingOnIssue()->getNameWithUsername(), '%time' => tbg_formatTime($issue->getWorkedOnSince(), 6)));
            ?>
                        <?php 
        }
        ?>
                        <div class="buttons">
                            <button class="button button-silver" onclick="$('viewissue_being_worked_on').hide();"><?php 
        echo __('OK');
        ?>
</button>
                        </div>
                    </div>
                <?php 
    }
    ?>
                <div class="issue_info error" id="blocking_div"<?php 
<br>
                <?php 
    if (!$user->getLastSeen()) {
        ?>
                    <b><?php 
        echo __('This user has not logged in yet');
        ?>
</b>
                <?php 
    } else {
        ?>
                    <b><?php 
        echo __('Last seen online at %time', array('%time' => ''));
        ?>
</b><?php 
        echo tbg_formatTime($user->getLastSeen(), 11);
        ?>
                <?php 
    }
    ?>
            </div>
        </li>
        <?php 
    \thebuggenie\core\framework\Event::createNew('core', 'useractions_top', $user)->trigger();
    ?>
        <?php 
    if (\thebuggenie\core\entities\User::isThisGuest() == false && $user->getID() != $tbg_user->getID()) {
        ?>
            <li style="<?php 
        if ($tbg_user->isFriend($user)) {
            ?>
<?php

switch ($notification->getNotificationType()) {
    case \thebuggenie\modules\vcs_integration\Vcs_integration::NOTIFICATION_COMMIT_MENTIONED:
        ?>
            <h1>
                <time><?php 
        echo tbg_formatTime($notification->getCreatedAt(), 20);
        ?>
</time>
                <?php 
        echo __('%user_name mentioned you in commit %rev', array('%user_name' => get_component_html('main/userdropdown', array('user' => $notification->getTriggeredByUser())), '%rev' => javascript_link_tag($notification->getTarget()->getRevisionString(), array('onclick' => "TBG.Main.Helpers.Backdrop.show('" . make_url('get_partial_for_backdrop', array('key' => 'vcs_integration_getcommit', 'commit_id' => $notification->getTarget()->getID())) . "');"))));
        ?>
            </h1>
            <div class="notification_content"><?php 
        echo $notification->getTarget()->getLog();
        ?>
</div>
            <?php 
        break;
}
Example #18
0
', {yes: {click: function() {TBG.Main.Profile.removeApplicationPassword('<?php 
    echo make_url('account_remove_application_password', array('id' => $password->getID(), 'csrf_token' => \thebuggenie\core\framework\Context::generateCSRFtoken()));
    ?>
', <?php 
    echo $password->getID();
    ?>
);}}, no: {click: TBG.Main.Helpers.Dialog.dismiss}});"><?php 
    echo __('Delete');
    ?>
</button>
                            <h4><?php 
    echo __('Application password: %password_name', array('%password_name' => $password->getName()));
    ?>
</h4>
                            <p><?php 
    echo __('Last used: %last_used_time, created at: %created_at_time', array('%last_used_time' => $password->getLastUsedAt() ? tbg_formatTime($password->getLastUsedAt(), 20) : __('never used'), '%created_at_time' => tbg_formatTime($password->getCreatedAt(), 20)));
    ?>
</p>
                        </li>
                    <?php 
}
?>
                </ul>
                <?php 
if (\thebuggenie\core\framework\Settings::isOpenIDavailable()) {
    ?>
                    <h3>
                        <?php 
    echo __('Linked OpenID accounts');
    ?>
                        <button class="button button-silver" onclick="TBG.Main.Helpers.Backdrop.show('<?php 
Example #19
0
                <?php 
        } elseif ($mode == 'article') {
            ?>
                    <?php 
            echo javascript_link_tag(image_tag('action_delete.png'), array('id' => $base_id . '_' . $file_id . '_remove_link', 'onclick' => "TBG.Main.Helpers.Dialog.show('" . __('Do you really want to detach this file?') . "', '" . __('If you detach this file, it will be deleted. This action cannot be undone. Are you sure you want to remove this file?') . "', {yes: {click: function() {TBG.Main.detachFileFromArticle('" . make_url('article_detach_file', array('article_id' => $article->getID(), 'file_id' => $file_id)) . "', " . $file_id . ", " . $article->getID() . "); }}, no: { click: TBG.Main.Helpers.Dialog.dismiss }});"));
            ?>
                <?php 
        }
        ?>
                <?php 
        echo image_tag('spinning_16.gif', array('id' => $base_id . '_' . $file_id . '_remove_indicator', 'style' => 'display: none;'));
        ?>
            </div>
        <?php 
    }
    ?>
        <div class="upload_details">
            <?php 
    echo __('%filename uploaded %date by %username', array('%filename' => '<span class="filename">' . $file->getOriginalFilename() . '</span>', '%date' => tbg_formatTime($file->getUploadedAt(), 23), '%username' => $file->getUploadedBy() instanceof \thebuggenie\core\entities\User ? '<a href="javascript:void(0);" onclick="TBG.Main.Helpers.Backdrop.show(\'' . make_url('get_partial_for_backdrop', array('key' => 'usercard', 'user_id' => $file->getUploadedBy()->getID())) . '\');" class="faded_out">' . $file->getUploadedBy()->getNameWithUsername() . '</a>' : __('unknown user')));
    ?>
        </div>
    </li>
<?php 
} else {
    ?>
    <li class="faded_out"><?php 
    echo __('Invalid file');
    ?>
</li>
<?php 
}
</td>
        <td style="padding-bottom: <?php 
    if (isset($extra_padding) && $extra_padding == true) {
        ?>
10<?php 
    } else {
        ?>
5<?php 
    }
    ?>
px;">
            <?php 
    if (isset($include_time) && $include_time == true) {
        ?>
<span class="time"><?php 
        echo tbg_formatTime($comment->getPosted(), 19);
        ?>
</span>&nbsp;<?php 
    }
    ?>
            <?php 
    if (isset($include_project) && $include_project == true) {
        ?>
<span class="faded_out smaller"><?php 
        echo link_tag(make_url('project_dashboard', array('project_key' => $issue->getProject()->getKey())), '[' . $issue->getProject()->getKey() . ']');
        ?>
</span><?php 
    }
    ?>
            <?php 
    $issue_title = tbg_decodeUTF8($issue->getFormattedTitle(true));
echo image_tag('spinning_16.gif', array('style' => 'float: right; margin: 13px 10px 0 0; display: none;', 'id' => 'mailing_account_' . $account->getID() . '_indicator'));
?>
        <span id="mailing_account_<?php 
echo $account->getID();
?>
_name"><?php 
echo $account->getName();
?>
</span> <span class="faded_out" style="font-size: 0.8em; font-weight: normal;"><?php 
echo $account->getServer();
?>
</span>
        <div style="font-size: 0.9em; font-weight: normal;">
            <span><?php 
echo __('Last checked: %time', array('%time' => ''));
?>
<span id="mailing_account_<?php 
echo $account->getID();
?>
_time" style="font-style: italic;"><?php 
echo $account->getTimeLastFetched() ? tbg_formatTime($account->getTimeLastFetched(), 6) : __('%last_checked never', array('%last_checked' => ''));
?>
</span>.</span>
            <span><?php 
echo __('Email(s) processed: %number', array('%number' => '<span id="mailing_account_' . $account->getID() . '_count" style="font-style: italic;">' . $account->getNumberOfEmailsLastFetched() . '</span>'));
?>
</span>
        </div>
    </h5>
</div>
    foreach ($custom_columns as $column) {
        ?>
                        <td class="smaller sc_<?php 
        echo $column->getKey();
        ?>
" <?php 
        if (!in_array($column->getKey(), $visible_columns)) {
            ?>
 style="display: none;"<?php 
        }
        ?>
><?php 
        $value = $issue->getCustomField($column->getKey());
        switch ($column->getType()) {
            case \thebuggenie\core\entities\CustomDatatype::DATE_PICKER:
                echo tbg_formatTime($value, 20);
                break;
            case \thebuggenie\core\entities\CustomDatatype::DROPDOWN_CHOICE_TEXT:
            case \thebuggenie\core\entities\CustomDatatype::RADIO_CHOICE:
                echo $value instanceof \thebuggenie\core\entities\CustomDatatypeOption ? $value->getValue() : '';
                break;
            case \thebuggenie\core\entities\CustomDatatype::INPUT_TEXT:
            case \thebuggenie\core\entities\CustomDatatype::INPUT_TEXTAREA_MAIN:
            case \thebuggenie\core\entities\CustomDatatype::INPUT_TEXTAREA_SMALL:
                echo $value;
                break;
            case \thebuggenie\core\entities\CustomDatatype::STATUS_CHOICE:
                if ($value instanceof \thebuggenie\core\entities\Status) {
                    ?>
<div class="sc_status_color status_badge" style="background-color: <?php 
                    echo $value->getColor();
Example #23
0
    ?>
                            <dl class="info">
                                <dt><?php 
    echo __('Start date');
    ?>
</dt>
                                <dd><?php 
    echo $milestone->getStartingDate() ? tbg_formatTime($milestone->getStartingDate(), 22, true, true) : '-';
    ?>
</dd>
                                <dt><?php 
    echo __('End date');
    ?>
</dt>
                                <dd><?php 
    echo $milestone->getScheduledDate() ? tbg_formatTime($milestone->getScheduledDate(), 22, true, true) : '-';
    ?>
</dd>
                            </dl>
                        </li>
                    <?php 
}
?>
                </ul>
            </div>
            <div id="planning_whiteboard">
                <div class="planning_indicator" id="whiteboard_indicator"><?php 
echo image_tag('spinning_30.gif');
?>
</div>
                <?php 
Example #24
0
 public function runBulkUpdateIssues(TBGRequest $request)
 {
     $issue_ids = $request['issue_ids'];
     $options = array('issue_ids' => array_values($issue_ids));
     TBGContext::loadLibrary('common');
     $options['last_updated'] = tbg_formatTime(time(), 20);
     if (!empty($issue_ids)) {
         $options['bulk_action'] = $request['bulk_action'];
         switch ($request['bulk_action']) {
             case 'assign_milestone':
                 $milestone = null;
                 if ($request['milestone'] == 'new') {
                     $milestone = new TBGMilestone();
                     $milestone->setProject(TBGContext::getCurrentProject());
                     $milestone->setName($request['milestone_name']);
                     $milestone->save();
                     $options['milestone_url'] = TBGContext::getRouting()->generate('project_planning_milestone', array('project_key' => $milestone->getProject()->getKey(), 'milestone_id' => $milestone->getID()));
                 } elseif ($request['milestone']) {
                     $milestone = new TBGMilestone($request['milestone']);
                 }
                 $milestone_id = $milestone instanceof TBGMilestone ? $milestone->getID() : null;
                 foreach (array_keys($issue_ids) as $issue_id) {
                     if (is_numeric($issue_id)) {
                         $issue = new TBGIssue($issue_id);
                         $issue->setMilestone($milestone_id);
                         $issue->save();
                     }
                 }
                 $options['milestone_id'] = $milestone_id;
                 $options['milestone_name'] = $milestone_id ? $milestone->getName() : '-';
                 break;
             case 'set_status':
                 if (is_numeric($request['status'])) {
                     $status = new TBGStatus($request['status']);
                     foreach (array_keys($issue_ids) as $issue_id) {
                         if (is_numeric($issue_id)) {
                             $issue = new TBGIssue($issue_id);
                             $issue->setStatus($status->getID());
                             $issue->save();
                         }
                     }
                     $options['status'] = array('color' => $status->getColor(), 'name' => $status->getName(), 'id' => $status->getID());
                 }
                 break;
             case 'set_severity':
                 if (is_numeric($request['severity'])) {
                     $severity = $request['severity'] ? new TBGSeverity($request['severity']) : null;
                     foreach (array_keys($issue_ids) as $issue_id) {
                         if (is_numeric($issue_id)) {
                             $issue = new TBGIssue($issue_id);
                             $severity_id = $severity instanceof TBGSeverity ? $severity->getID() : 0;
                             $issue->setSeverity($severity_id);
                             $issue->save();
                         }
                     }
                     $options['severity'] = array('name' => $severity instanceof TBGSeverity ? $severity->getName() : '-', 'id' => $severity instanceof TBGSeverity ? $severity->getID() : 0);
                 }
                 break;
             case 'set_resolution':
                 if (is_numeric($request['resolution'])) {
                     $resolution = $request['resolution'] ? new TBGResolution($request['resolution']) : null;
                     foreach (array_keys($issue_ids) as $issue_id) {
                         if (is_numeric($issue_id)) {
                             $issue = new TBGIssue($issue_id);
                             $resolution_id = $resolution instanceof TBGResolution ? $resolution->getID() : 0;
                             $issue->setResolution($resolution_id);
                             $issue->save();
                         }
                     }
                     $options['resolution'] = array('name' => $resolution instanceof TBGResolution ? $resolution->getName() : '-', 'id' => $resolution instanceof TBGResolution ? $resolution->getID() : 0);
                 }
                 break;
             case 'set_priority':
                 if (is_numeric($request['priority'])) {
                     $priority = $request['priority'] ? new TBGPriority($request['priority']) : null;
                     foreach (array_keys($issue_ids) as $issue_id) {
                         if (is_numeric($issue_id)) {
                             $issue = new TBGIssue($issue_id);
                             $priority_id = $priority instanceof TBGPriority ? $priority->getID() : 0;
                             $issue->setPriority($priority_id);
                             $issue->save();
                         }
                     }
                     $options['priority'] = array('name' => $priority instanceof TBGPriority ? $priority->getName() : '-', 'id' => $priority instanceof TBGPriority ? $priority->getID() : 0);
                 }
                 break;
             case 'set_category':
                 if (is_numeric($request['category'])) {
                     $category = $request['category'] ? new TBGCategory($request['category']) : null;
                     foreach (array_keys($issue_ids) as $issue_id) {
                         if (is_numeric($issue_id)) {
                             $issue = new TBGIssue($issue_id);
                             $category_id = $category instanceof TBGCategory ? $category->getID() : 0;
                             $issue->setCategory($category_id);
                             $issue->save();
                         }
                     }
                     $options['category'] = array('name' => $category instanceof TBGCategory ? $category->getName() : '-', 'id' => $category instanceof TBGCategory ? $category->getID() : 0);
                 }
                 break;
         }
     }
     return $this->renderJSON($options);
 }
		<li id="updated_at_field" class="issue_detail_field">
			<dl class="viewissue_list">
				<dt id="updated_at_header">
					<?php 
echo __('Last updated');
?>
				</dt>
				<dd class="hoverable">
					<time datetime="<?php 
echo tbg_formatTime($issue->getLastUpdatedTime(), 24);
?>
" title="<?php 
echo tbg_formatTime($issue->getLastUpdatedTime(), 21);
?>
"><?php 
echo tbg_formatTime($issue->getLastUpdatedTime(), 20);
?>
</time>
				</dd>
			</dl>
		</li>
		<li id="estimated_time_field"<?php 
if (!$issue->isEstimatedTimeVisible()) {
    ?>
 style="display: none;"<?php 
}
?>
 class="issue_detail_field<?php 
if ($issue->isEstimatedTimeChanged()) {
    ?>
 issue_detail_changed<?php 
 public function do_execute()
 {
     $this->cliEcho('Querying ');
     $this->cliEcho($this->_getCurrentRemoteServer(), 'white', 'bold');
     $this->cliEcho(" for list of issues ...\n\n");
     $this->cliEcho("Filters:\n", 'white', 'bold');
     $options = array('format' => 'json');
     $options["state"] = $this->getProvidedArgument("state", "all");
     $this->cliEcho("State: ");
     $this->cliEcho($options["state"], "yellow", "bold");
     $this->cliEcho("\n");
     $options["issuetype"] = $this->getProvidedArgument("issuetype", "all");
     $this->cliEcho("Issuetypes: ");
     $this->cliEcho($options["issuetype"], "yellow", "bold");
     $this->cliEcho("\n");
     $options["assigned_to"] = $this->getProvidedArgument("assigned_to", "all");
     $this->cliEcho("Assigned to: ");
     $this->cliEcho($options["assigned_to"], "yellow", "bold");
     $this->cliEcho("\n");
     $options["assigned"] = $this->getProvidedArgument("state", "all");
     $options['project_key'] = $this->getProvidedArgument('project_key');
     $response = $this->getRemoteResponse($this->getRemoteURL('project_list_issues', $options));
     $this->cliEcho("\n");
     if (!empty($response) && $response->count > 0) {
         TBGContext::loadLibrary('common');
         $this->cliEcho("The following {$response->count} issues were found:\n", 'white', 'bold');
         foreach ($response->issues as $issue) {
             //$this->cliEcho("ID: {$issue->id} ", 'yellow');
             if (mb_strtolower($options['state']) == 'all') {
                 $this->cliEcho($issue->state == TBGIssue::STATE_OPEN ? "[open] " : "[closed] ");
             }
             $this->cliEcho($issue->issue_no, 'green', 'bold');
             $this->cliEcho(" - ");
             $this->cliEcho(html_entity_decode($issue->title), 'white', 'bold');
             $this->cliEcho("\n");
             if ($this->getProvidedArgument('detailed', 'no') == 'yes') {
                 $this->cliEcho("Posted: ", 'blue', 'bold');
                 $this->cliEcho(tbg_formatTime($issue->created_at, 21));
                 $this->cliEcho(" by ");
                 $this->cliEcho($issue->posted_by, 'cyan');
                 $this->cliEcho("\n");
                 $this->cliEcho("Updated: ", 'blue', 'bold');
                 $this->cliEcho(tbg_formatTime($issue->last_updated, 21));
                 $this->cliEcho("\n");
                 $this->cliEcho("Assigned to: ", 'blue', 'bold');
                 $this->cliEcho($issue->assigned_to, 'yellow', 'bold');
                 $this->cliEcho(" | ", 'white', 'bold');
                 $this->cliEcho("Status: ", 'blue', 'bold');
                 $this->cliEcho($issue->status);
                 $this->cliEcho("\n\n");
             }
         }
         $this->cliEcho("\n");
         $this->cliEcho("If you are going to update or query any of these issues, use the \n");
         $this->cliEcho("issue number shown in front of the issue (do not include the \n");
         $this->cliEcho("issue type), ex:\n");
         $this->cliEcho("./tbg_cli", 'green');
         $this->cliEcho(" remote:update_issue projectname ");
         $this->cliEcho("300\n", 'white', 'bold');
         $this->cliEcho("./tbg_cli", 'green');
         $this->cliEcho(" remote:show_issue projectname ");
         $this->cliEcho("300\n", 'white', 'bold');
         $this->cliEcho("./tbg_cli", 'green');
         $this->cliEcho(" remote:list_transitions projectname ");
         $this->cliEcho("300\n", 'white', 'bold');
         $this->cliEcho("\nor\n");
         $this->cliEcho("./tbg_cli", 'green');
         $this->cliEcho(" remote:update_issue projectname ");
         $this->cliEcho("PREFIX-12\n", 'white', 'bold');
         $this->cliEcho("./tbg_cli", 'green');
         $this->cliEcho(" remote:show_issue projectname ");
         $this->cliEcho("PREFIX-12\n", 'white', 'bold');
         $this->cliEcho("./tbg_cli", 'green');
         $this->cliEcho(" remote:list_transitions projectname ");
         $this->cliEcho("PREFIX-12\n", 'white', 'bold');
         $this->cliEcho("\n");
         $this->cliEcho("\n");
     } else {
         $this->cliEcho("No issues available matching your filters.\n\n");
     }
 }
        if ($article instanceof TBGWikiArticle) {
            ?>
			<li class="issue_open<?php 
            if ($cc == count($articles) && $resultcount == count($articles)) {
                ?>
 last<?php 
            }
            ?>
"><?php 
            echo image_tag('tab_publish.png', array('class' => 'informal'), false, 'publish');
            ?>
<div><?php 
            echo strlen($article->getName()) <= 32 ? $article->getName() : str_pad(substr($article->getName(), 0, 32), 35, '...');
            ?>
</div><span class="informal"><?php 
            echo __('Last updated %updated_at%', array('%updated_at%' => tbg_formatTime($article->getLastUpdatedDate(), 6)));
            ?>
</span><span class="informal url"><?php 
            echo make_url('publish_article', array('article_name' => $article->getName()));
            ?>
</span></li>
		<?php 
        }
        ?>
	<?php 
    }
    ?>
	<?php 
    if (true || $resultcount - $cc > 0) {
        ?>
		<li class="find_more_issues last">
            echo __('The sprint has ended');
            ?>
</i>
                    </td>
                </tr>
            <?php 
        } elseif ($activity['change_type'] == 'milestone_release') {
            ?>
                <tr>
                    <td class="imgtd" style="padding-top: 10px;"><?php 
            echo image_tag('icon_milestone.png');
            ?>
</td>
                    <td style="clear: both; padding-top: 10px;">
                        <span class="time"><?php 
            echo tbg_formatTime($timestamp, 19);
            ?>
</span>&nbsp;<b><?php 
            echo $activity['info'];
            ?>
</b><br><i><?php 
            echo __('A new milestone has been reached');
            ?>
</i>
                    </td>
                </tr>
            <?php 
        } else {
            ?>
                <?php 
            include_component('main/logitem', array('log_action' => $activity, 'include_time' => true, 'include_user' => true, 'extra_padding' => true, 'include_details' => true, 'include_issue_title' => !($prev_timestamp == $activity['timestamp'] && $prev_issue == $activity['target'])));
Example #29
0
?>
</span>
    <div class="release_date <?php 
if ($build->isReleased()) {
    echo 'released';
}
?>
" id="build_<?php 
echo $b_id;
?>
_release_date">
        <?php 
if ($build->isReleased()) {
    ?>
            <?php 
    $release_date_text = $build->hasReleaseDate() ? __('Released %release_date', array('%release_date' => tbg_formatTime($build->getReleaseDate(), 7, true, true))) : __('Released');
    ?>
        <?php 
} else {
    ?>
            <?php 
    $release_date_text = __('Not released yet');
    ?>
        <?php 
}
?>
        <?php 
if ($build->hasDownload()) {
    ?>
            <?php 
    $release_date_text = __('%release_date, download: %download_filename', array('%release_date' => $release_date_text, '%download_filename' => $build->hasFile() ? link_tag(make_url('downloadfile', array('id' => $build->getFile()->getID())), $build->getFile()->getOriginalFilename()) : link_tag($build->getFileURL())));
Example #30
0
    ?>
				<div class="greenbox" style="margin: 0 0 5px 5px; font-size: 14px;">
					<b><?php 
    echo $message;
    ?>
</b>
				</div>
			<?php 
}
?>
			<?php 
if (isset($revision) && !$error) {
    ?>
				<div class="lightyellowbox" style="margin: 0 0 5px 5px; font-size: 14px;">
					<?php 
    echo __('You are now viewing a previous revision of this article - revision %revision_number %date, by %author', array('%revision_number' => '<b>' . $revision . '</b>', '%date' => '<span class="faded_out">[ ' . tbg_formatTime($article->getPostedDate(), 20) . ' ]</span>', '%author' => $article->getAuthor() instanceof TBGUser ? $article->getAuthor()->getName() : __('System')));
    ?>
<br>
					<b><?php 
    echo link_tag(make_url('publish_article', array('article_name' => $article->getName())), __('Show current version'));
    ?>
</b>
				</div>
			<?php 
}
?>
			<?php 
if ($article->getID()) {
    ?>
				<?php 
    include_component('articledisplay', array('article' => $article, 'show_article' => true, 'redirected_from' => $redirected_from));