?>
</div>
                            <?php 
    if ($step->getNumberOfOutgoingTransitions() == 0) {
        ?>
                                <div class="faded_out"><?php 
        echo __("This step doesn't have any outgoing transitions");
        ?>
</div>
                            <?php 
    } else {
        ?>
                                <?php 
        $output = array();
        foreach ($step->getOutgoingTransitions() as $transition) {
            $output[] = get_component_html('configuration/workflowtransition', array('transition' => $transition, 'direction' => 'outgoing', 'step' => $step));
        }
        echo join($glue, $output);
        ?>
                            <?php 
    }
    ?>
                        </div>
                    </div>
                    <?php 
    include_component('configuration/workflowaddtransition', array('step' => $step));
    ?>
                    <div id="workflow_details_step">
                        <dl id="step_details_info">
                            <dt><?php 
    echo __('Name');
    echo mb_substr($commit->getRevision(), 0, 7);
} else {
    echo $commit->getRevision();
}
?>
</a>
            <div class="commenttitle">
                <?php 
if ($branchname !== null) {
    ?>
<span class="commitbranch"><?php 
    echo $branchname;
    ?>
</span> <?php 
}
echo __('Revision %rev by %user', array('%rev' => "<a href=" . $link_rev . ">" . $commit->getRevision() . "</a>", '%user' => '<div style="display: inline;">' . get_component_html('main/userdropdown', array('user' => $commit->getAuthor(), 'size' => 'large')) . '</div>'));
?>
            </div>
            <div class="commentdate" id="commit_<?php 
echo $commit->getID();
?>
_date"><?php 
echo tbg_formattime($commit->getDate(), 12);
?>
 - <?php 
echo __('Preceeded by %prev', array('%prev' => "<a href=" . $link_old . ">" . $commit->getPreviousRevision() . "</a>"));
?>
</div>
        </div>

        <div class="commentbody article commit_main" id="commit_<?php 
<?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;
}
            <?php 
        if ($issue->isAssigned()) {
            ?>
                <span class="faded_out">
                    <?php 
            if ($issue->getAssignee() instanceof \thebuggenie\core\entities\User) {
                ?>
                        (<?php 
                echo __('Assigned to %assignee', array('%assignee' => get_component_html('main/userdropdown', array('user' => $issue->getAssignee(), 'show_avatar' => false))));
                ?>
)
                    <?php 
            } else {
                ?>
                        (<?php 
                echo __('Assigned to %assignee', array('%assignee' => get_component_html('main/teamdropdown', array('team' => $issue->getAssignee()))));
                ?>
)
                    <?php 
            }
            ?>
                </span>
            <?php 
        }
        ?>
            <?php 
        echo link_tag(make_url('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo())), $issue->getFormattedIssueNo(true, true) . ' - <span class="issue_title">' . $issue->getTitle() . '</span>');
        ?>
            <?php 
        if ($milestone->isSprint()) {
            ?>
<?php

$found = false;
foreach ($editions as $releases) {
    if (array_key_exists(0, $releases)) {
        $found = true;
        if ($releases[0]->getEdition() instanceof \thebuggenie\core\entities\Edition) {
            echo '<div class="tab_header">' . $releases[0]->getEdition()->getName() . '</div>';
        }
        echo '<ul class="simple_list">' . get_component_html('project/release', array('build' => $releases[0])) . '</ul>';
    }
}
if ($found == false) {
    ?>
<p class="content faded_out"><?php 
    echo __('There are no downloadable releases at the moment');
    ?>
</p><?php 
}
                ?>
</time>
                            <?php 
                echo __('%user_name posted a %comment on %article_name', array('%user_name' => get_component_html('main/userdropdown', array('user' => $notification->getTriggeredByUser())), '%comment' => link_tag(make_url('publish_article', array('article_name' => $notification->getTarget()->getTarget()->getName())) . '#comment_' . $notification->getTarget()->getID(), __('%username_posted_a comment %on_issue', array('%username_posted_a' => '', '%on_issue' => ''))), '%article_name' => link_tag(make_url('publish_article', array('article_name' => $notification->getTarget()->getTarget()->getName())), $notification->getTarget()->getTarget()->getName())));
                ?>
                        </h1>
                        <?php 
                break;
            case \thebuggenie\core\entities\Notification::TYPE_ARTICLE_UPDATED:
                ?>
                        <h1>
                            <time><?php 
                echo tbg_formatTime($notification->getCreatedAt(), 20);
                ?>
</time>
                            <?php 
                echo __('%user_name updated %article_name', array('%user_name' => get_component_html('main/userdropdown', array('user' => $notification->getTriggeredByUser())), '%article_name' => link_tag(make_url('publish_article', array('article_name' => $notification->getTarget()->getTarget()->getName())), $notification->getTarget()->getTarget()->getName())));
                ?>
                        </h1>
                        <?php 
                break;
            default:
                \thebuggenie\core\framework\Event::createNew('core', '_notification_view', $notification)->trigger();
        }
        ?>
        </li>
        <?php 
    }
    ?>
    <?php 
}
<?php

switch ($notification->getNotificationType()) {
    case \thebuggenie\modules\vcs_integration\Vcs_integration::NOTIFICATION_COMMIT_MENTIONED:
        ?>
                <?php 
        echo tbg_formatTime($notification->getCreatedAt(), 20);
        ?>
                <?php 
        echo __('%user_name mentioned you in commit %rev', array('%user_name' => get_component_html('main/userdropdown_inline.text', array('user' => $notification->getTriggeredByUser())), '%rev' => $notification->getTarget()->getRevisionString()));
        ?>
            <?php 
        echo $notification->getTarget()->getLog();
        ?>
            <?php 
        break;
}
				</div>
			<?php 
}
?>
			<div class="commenttitle">
				<?php 
if ($comment->isSystemComment()) {
    ?>
					<?php 
    echo __('Comment posted on behalf of %user%', array('%user%' => '<div style="display: inline;">' . get_component_html('main/userdropdown', array('user' => $comment->getPostedBy(), 'size' => 'small')) . '</div>'));
    ?>
				<?php 
} else {
    ?>
					<?php 
    echo __('Comment posted by %user%', array('%user%' => '<div style="display: inline;">' . get_component_html('main/userdropdown', array('user' => $comment->getPostedBy(), 'size' => 'small')) . '</div>'));
    ?>
				<?php 
}
?>
			</div>
			<div class="commentdate" id="comment_<?php 
echo $comment->getID();
?>
_date"><?php 
echo tbg_formattime($comment->getPosted(), 12);
?>
</div>
		</div>
		<div class="rounded_box lightyellow borderless shadowed comment_delete" id="comment_delete_confirm_<?php 
echo $comment->getID();
Beispiel #9
0
 public function runAddAffected(framework\Request $request)
 {
     framework\Context::loadLibrary('ui');
     try {
         $issue = entities\Issue::getB2DBTable()->selectById($request['issue_id']);
         $statuses = entities\Status::getAll();
         switch ($request['item_type']) {
             case 'edition':
                 if (!$issue->getProject()->isEditionsEnabled()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('Editions are disabled')));
                 } elseif (!$issue->canEditAffectedEditions()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('You are not allowed to do this')));
                 }
                 $edition = entities\Edition::getB2DBTable()->selectById($request['which_item_edition']);
                 if (tables\IssueAffectsEdition::getTable()->getByIssueIDandEditionID($issue->getID(), $edition->getID())) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('%item is already affected by this issue', array('%item' => $edition->getName()))));
                 }
                 $result = $issue->addAffectedEdition($edition);
                 if ($result !== false) {
                     $itemtype = 'edition';
                     $item = $result;
                     $itemtypename = framework\Context::getI18n()->__('Edition');
                     $content = get_component_html('main/affecteditem', array('item' => $item, 'itemtype' => $itemtype, 'itemtypename' => $itemtypename, 'issue' => $issue, 'statuses' => $statuses));
                 }
                 $message = framework\Context::getI18n()->__('Edition <b>%edition</b> is now affected by this issue', array('%edition' => $edition->getName()), true);
                 break;
             case 'component':
                 if (!$issue->getProject()->isComponentsEnabled()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('Components are disabled')));
                 } elseif (!$issue->canEditAffectedComponents()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('You are not allowed to do this')));
                 }
                 $component = entities\Component::getB2DBTable()->selectById($request['which_item_component']);
                 if (tables\IssueAffectsComponent::getTable()->getByIssueIDandComponentID($issue->getID(), $component->getID())) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('%item is already affected by this issue', array('%item' => $component->getName()))));
                 }
                 $result = $issue->addAffectedComponent($component);
                 if ($result !== false) {
                     $itemtype = 'component';
                     $item = $result;
                     $itemtypename = framework\Context::getI18n()->__('Component');
                     $content = get_component_html('main/affecteditem', array('item' => $item, 'itemtype' => $itemtype, 'itemtypename' => $itemtypename, 'issue' => $issue, 'statuses' => $statuses));
                 }
                 $message = framework\Context::getI18n()->__('Component <b>%component</b> is now affected by this issue', array('%component' => $component->getName()), true);
                 break;
             case 'build':
                 if (!$issue->getProject()->isBuildsEnabled()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('Releases are disabled')));
                 } elseif (!$issue->canEditAffectedBuilds()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('You are not allowed to do this')));
                 }
                 $build = entities\Build::getB2DBTable()->selectById($request['which_item_build']);
                 if (tables\IssueAffectsBuild::getTable()->getByIssueIDandBuildID($issue->getID(), $build->getID())) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('%item is already affected by this issue', array('%item' => $build->getName()))));
                 }
                 $result = $issue->addAffectedBuild($build);
                 if ($result !== false) {
                     $itemtype = 'build';
                     $item = $result;
                     $itemtypename = framework\Context::getI18n()->__('Release');
                     $content = get_component_html('main/affecteditem', array('item' => $item, 'itemtype' => $itemtype, 'itemtypename' => $itemtypename, 'issue' => $issue, 'statuses' => $statuses));
                 }
                 $message = framework\Context::getI18n()->__('Release <b>%build</b> is now affected by this issue', array('%build' => $build->getName()), true);
                 break;
             default:
                 throw new \Exception('Internal error');
         }
         $editions = array();
         $components = array();
         $builds = array();
         if ($issue->getProject()->isEditionsEnabled()) {
             $editions = $issue->getEditions();
         }
         if ($issue->getProject()->isComponentsEnabled()) {
             $components = $issue->getComponents();
         }
         if ($issue->getProject()->isBuildsEnabled()) {
             $builds = $issue->getBuilds();
         }
         $count = count($editions) + count($components) + count($builds);
         return $this->renderJSON(array('content' => $content, 'message' => $message, 'itemcount' => $count));
     } catch (\Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('error' => $e->getMessage()));
     }
 }
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td valign="middle" class="faded_out">
						<?php 
if ($related_issue->isAssigned()) {
    ?>
							<?php 
    if ($related_issue->getAssignee()->getType() == TBGIdentifiableClass::TYPE_USER) {
        ?>
								<?php 
        echo __('Assigned to %user%', array('%user%' => '</td><td style="padding-left: 5px;" class="faded_out">' . get_component_html('main/userdropdown', array('user' => $related_issue->getAssignee(), 'size' => 'small'))));
        ?>
							<?php 
    } elseif ($related_issue->getAssignee()->getType() == TBGIdentifiableClass::TYPE_TEAM) {
        ?>
								<?php 
        echo __('Assigned to %team%', array('%team%' => '</td><td style="padding-left: 5px;" class="faded_out">' . get_component_html('main/teamdropdown', array('team' => $related_issue->getAssignee(), 'size' => 'small'))));
        ?>
							<?php 
    }
    ?>
						<?php 
}
?>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</div>
    case 'hgweb':
        if (isset($theUser)) {
            $user = '******' . get_component_html('main/userdropdown', array('user' => $theUser, 'size' => 'small')) . '</div>';
        }
        ?>
			<span class="commenttitle" style="float: left; padding-right: 5px;"><a href="<?php 
        echo $link_rev;
        ?>
" target="_new"><?php 
        echo __('Revision %revno%', array('%revno%' => $revision[0] . ':' . $revision[1])) . '</a> - ' . __('committed on %date% by', array('%date%' => tbg_formatTime($date, 10))) . '</span> ' . $user;
        ?>
			<?php 
        break;
    default:
        if (isset($theUser)) {
            $user = '******' . get_component_html('main/userdropdown', array('user' => $theUser, 'size' => 'small')) . '</div>';
        }
        ?>
			<span class="commenttitle" style="float: left; padding-right: 5px;"><a href="<?php 
        echo $link_rev;
        ?>
" target="_new"><?php 
        echo __('Revision %revno%', array('%revno%' => $revision)) . '</a> - ' . __('committed on %date% by', array('%date%' => tbg_formatTime($date, 10))) . '</span> ' . $user;
        ?>
			<?php 
        break;
}
?>
</div>
<div id="checkin_details_<?php 
echo $id;
Beispiel #12
0
echo image_tag('spinning_32.gif');
?>
<br>
		<?php 
echo __('Please wait ...');
?>
	</div>
	<div id="fullpage_backdrop_content" class="fullpage_backdrop_content"> </div>
</div>
<?php 
if (TBGContext::getRouting()->getCurrentRouteName() != 'login_page' && $tbg_user->isGuest()) {
    ?>
	<div id="login_backdrop" class="fullpage_backdrop" style="display: none;">
		<div id="login_content" class="fullpage_backdrop_content">
			<?php 
    include_component('main/loginpopup', array('content' => get_component_html('main/login'), 'mandatory' => false));
    ?>
		</div>
	</div>
<?php 
}
if (TBGSettings::isPersonaAvailable() && ($tbg_user->isGuest() || $tbg_request->hasCookie('tbg3_persona_session'))) {
    ?>
	<script src="https://login.persona.org/include.js"></script>
	<script type="text/javascript">
		document.observe('dom:loaded', function() {
			var currentUser = <?php 
    echo !$tbg_user->isGuest() ? "'{$tbg_user->getEmail()}'" : 'null';
    ?>
;
                ?>
</time>
                            <?php 
                echo __('%user_name mentioned you in an article %article_name', array('%user_name' => get_component_html('main/userdropdown_inline', array('user' => $notification->getTriggeredByUser())), '%article_name' => link_tag(make_url('publish_article', array('article_name' => $notification->getTarget()->getName())), $notification->getTarget()->getName())));
                ?>
                        </h1>
                        <?php 
                break;
            default:
                \thebuggenie\core\framework\Event::createNew('core', '_notification_view', $notification)->trigger();
        }
        ?>
        </li>
            <?php 
        // Replace multiple spaces with single space with regex, apply trim, decode entities to show non standard characters and strip tags to remove any left / decoded "injections" to retrieve only valid text of notification.
        if (($notification_text = strip_tags(html_entity_decode(trim(preg_replace('!\\s+!', ' ', get_component_html('main/notification_text', compact('notification')))), ENT_COMPAT, \thebuggenie\core\framework\Context::getI18n()->getCharset()))) != '') {
            ?>
                <script>
                    require(['domReady', 'thebuggenie/tbg'], function (domReady, TBG) {
                        domReady(function () {
                            TBG.Main.Notifications.Web.Send("<?php 
            echo __('New notification');
            ?>
", "<?php 
            echo $notification_text;
            ?>
", '<?php 
            echo $notification->getID();
            ?>
', '<?php 
            echo $notification->getTriggeredByUser()->getAvatarURL();
            break;
        case \thebuggenie\core\entities\Notification::TYPE_ISSUE_MENTIONED:
            ?>
                    <?php 
            echo $notification->getTarget()->getProject()->getName();
            ?>
                    <?php 
            echo tbg_formatTime($notification->getCreatedAt(), 20);
            ?>
                    <?php 
            echo __('%user_name mentioned you in an issue %issue_no', array('%user_name' => get_component_html('main/userdropdown_inline.text', array('user' => $notification->getTriggeredByUser())), '%issue_no' => $notification->getTarget()->getFormattedIssueNo(true, true) . ' - ' . $notification->getTarget()->getTitle()));
            ?>
                    <?php 
            break;
        case \thebuggenie\core\entities\Notification::TYPE_ARTICLE_MENTIONED:
            ?>
                    <?php 
            echo $notification->getTarget()->getProject()->getName();
            ?>
                    <?php 
            echo tbg_formatTime($notification->getCreatedAt(), 20);
            ?>
                    <?php 
            echo __('%user_name mentioned you in an article %article_name', array('%user_name' => get_component_html('main/userdropdown_inline.text', array('user' => $notification->getTriggeredByUser())), '%article_name' => $notification->getTarget()->getName()));
            ?>
                    <?php 
            break;
        default:
            \thebuggenie\core\framework\Event::createNew('core', '_notification_view_text', $notification)->trigger();
    }
}