本文整理汇总了PHP中thebuggenie\core\framework\Context::getCurrentProject方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getCurrentProject方法的具体用法?PHP Context::getCurrentProject怎么用?PHP Context::getCurrentProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\framework\Context
的用法示例。
在下文中一共展示了Context::getCurrentProject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runProjectCommitsMore
public function runProjectCommitsMore(framework\Request $request)
{
$this->forward403unless($request->isPost());
$this->selected_project = Project::getByKey($request['project_key']);
framework\Context::setCurrentProject($this->selected_project);
if (framework\Context::getModule('vcs_integration')->getSetting('vcs_mode_' . framework\Context::getCurrentProject()->getID()) == Vcs_integration::MODE_DISABLED) {
return $this->return404(framework\Context::getI18n()->__('VCS Integration has been disabled for this project'));
}
$offset = $request->getParameter('offset', 0);
$this->commits = Commit::getByProject($this->selected_project->getID(), 40, $offset, $request->getParameter('branchname'), $request->getParameter('gitlab_repos_nss'));
return $this->renderJSON(array('content' => $this->getComponentHTML('vcs_integration/projectcommits', array('commits' => $this->commits, 'selected_project' => $this->selected_project)), 'offset' => $offset + 40));
}
示例2: runReleaseCenter
public function runReleaseCenter(framework\Request $request)
{
$this->forward403if(framework\Context::getCurrentProject()->isArchived() || !$this->getUser()->canManageProjectReleases(framework\Context::getCurrentProject()));
$this->build_error = framework\Context::getMessageAndClear('build_error');
}
示例3: extractIssues
public static function extractIssues($matches)
{
$issue = Issue::getIssueFromLink($matches["issues"]);
if ($issue instanceof Issue) {
if (!framework\Context::isProjectContext() || framework\Context::isProjectContext() && $issue->getProjectID() == framework\Context::getCurrentProject()->getID()) {
$this->_quickfound_issues[] = $issue;
}
}
}
示例4: __
<div class="article">
<div class="header">Special:<?php
echo $projectnamespace != '' ? "<span class='faded_out'>{$projectnamespace}</span>" : '';
?>
All Pages</div>
<div class="greybox" style="margin: 15px 0;">
<?php
if (\thebuggenie\core\framework\Context::isProjectContext()) {
?>
<?php
echo __('Note: This page lists all articles for "%project_name". For a list of global articles, see %all_pages', array('%project_name' => \thebuggenie\core\framework\Context::getCurrentProject()->getName(), '%all_pages' => link_tag(make_url('publish_article', array('article_name' => "Special:AllPages")), 'Special:AllPages')));
?>
<?php
} else {
?>
<?php
echo __('Note: This page lists all articles in the global scope. For a list of project articles, see the corresponding "All pages" for that specific project');
?>
<?php
}
?>
</div>
<p>
<?php
echo __('Below is a listing of all pages.');
?>
</p>
<?php
include_component('publish/articleslist', compact('articles'));
?>
</div>
示例5: get_spaced_name
</div>
<?php
} else {
?>
<?php
if ($article->getArticleType() == \thebuggenie\modules\publish\entities\Article::TYPE_MANUAL) {
echo get_spaced_name($article->getManualName());
} else {
$namespaces = explode(':', $article_name);
if (count($namespaces) > 1 && $namespaces[0] == 'Category') {
array_shift($namespaces);
echo '<span class="faded_out blue">Category:</span>';
}
if (\thebuggenie\core\framework\Context::isProjectContext() && count($namespaces) > 1 && mb_strtolower($namespaces[0]) == \thebuggenie\core\framework\Context::getCurrentProject()->getKey()) {
array_shift($namespaces);
echo '<span>', \thebuggenie\core\framework\Context::getCurrentProject()->getName(), ':</span>';
}
echo \thebuggenie\core\framework\Settings::get('allow_camelcase_links', 'publish', \thebuggenie\core\framework\Context::getScope()->getID(), 0) ? get_spaced_name(implode(':', $namespaces)) : implode(':', $namespaces);
}
?>
<?php
}
?>
<?php
if ($article->getID() && $mode) {
switch ($mode) {
/* case 'edit':
?><span class="faded_out"><?php echo __('%article_name ~ Edit', array('%article_name' => '')); ?></span><?php
break; */
case 'history':
?>
示例6: __
<div class="article">
<div class="header">Special:<?php
echo $projectnamespace != '' ? "<span class='faded_out'>{$projectnamespace}</span>" : '';
?>
Uncategorized Categories</div>
<?php
if (\thebuggenie\core\framework\Context::isProjectContext()) {
?>
<div class="greybox" style="margin: 15px 0;">
<?php
echo __('Note: This page lists all categories without any parent categories in "%project_name". For a list of global categories with no parent categories, see %uncategorized_categories', array('%project_name' => \thebuggenie\core\framework\Context::getCurrentProject()->getName(), '%uncategorized_categories' => link_tag(make_url('publish_article', array('article_name' => "Special:UncategorizedCategories")), 'Special:UncategorizedCategories')));
?>
</div>
<?php
}
?>
<p>
<?php
echo __('Below is a listing of categories that have no parent categories.');
?>
</p>
<?php
include_component('publish/articleslist', array('articles' => $articles, 'include_redirects' => false));
?>
</div>
示例7: __construct
/**
* Setup the parser object
*
* @param string $text The text to be parsed
* @param boolean $use_toc [optional] Whether to use a TOC if found
* @param string $toc_base_id [optional] Base id to use for the TOC element
*/
public function __construct($text, $use_toc = false, $toc_base_id = null)
{
$this->text = str_replace("\r\n", "\n", $text);
$this->use_toc = $use_toc;
$this->toc_base_id = $toc_base_id;
if (framework\Context::isProjectContext()) {
$this->namespace = framework\Context::getCurrentProject()->getKey();
}
if (!framework\Context::isCLI()) {
framework\Context::loadLibrary('ui');
}
}
示例8: runAssignMilestone
/**
* Assign a user story to a milestone id
*
* @Route(url="/assign/issue/milestone/:milestone_id")
*
* @param framework\Request $request
*/
public function runAssignMilestone(framework\Request $request)
{
$this->forward403if(framework\Context::getCurrentProject()->isArchived());
$this->forward403unless($this->_checkProjectPageAccess('project_scrum') && framework\Context::getUser()->canAssignScrumUserStories($this->selected_project));
try {
$issue = \thebuggenie\core\entities\Issue::getB2DBTable()->selectById((int) $request['issue_id']);
$milestone = \thebuggenie\core\entities\tables\Milestones::getTable()->selectById($request['milestone_id']);
if (!$issue instanceof \thebuggenie\core\entities\Issue) {
throw new \Exception($this->getI18n()->__('This is not a valid issue'));
}
$issue->setMilestone($milestone);
$issue->save();
foreach ($issue->getChildIssues() as $child_issue) {
$child_issue->setMilestone($milestone);
$child_issue->save();
}
$new_issues = $milestone instanceof \thebuggenie\core\entities\Milestone ? $milestone->countIssues() : 0;
$new_e_points = $milestone instanceof \thebuggenie\core\entities\Milestone ? $milestone->getPointsEstimated() : 0;
$new_e_hours = $milestone instanceof \thebuggenie\core\entities\Milestone ? $milestone->getHoursEstimated() : 0;
return $this->renderJSON(array('issue_id' => $issue->getID(), 'issues' => $new_issues, 'points' => $new_e_points, 'hours' => $new_e_hours));
} catch (\Exception $e) {
$this->getResponse()->setHttpStatus(400);
return $this->renderJSON(array('error' => $e->getMessage()));
}
}
示例9: __
?>
</td>
<td class="faded_out" title="<?php
echo __('%count issues open of %total_count issues total', array('%count' => $counts[0]['open'], '%total_count' => $counts[0]['open'] + $counts[0]['closed']));
?>
"><?php
echo $counts[0]['open'];
?>
<span style="font-weight: normal;">/ <?php
echo $counts[0]['open'] + $counts[0]['closed'];
?>
(<?php
echo (int) $counts[0]['percentage'];
?>
%)</span></td>
<td class="faded_out"><?php
include_component('main/percentbar', array('percent' => 100 - $counts[0]['percentage'], 'height' => 14));
?>
</td>
</tr>
</table>
<?php
echo link_tag(make_url('project_statistics', array('project_key' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey())), __('Show more statistics'), array('class' => 'button button-silver dash', 'title' => __('More statistics')));
if ($key != 'workflowstep') {
?>
<?php
echo link_tag(make_url('project_issues', array('project_key' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey(), 'search' => true, 'fs[state]' => array('o' => '=', 'v' => \thebuggenie\core\entities\Issue::STATE_OPEN), 'groupby' => $key, 'grouporder' => 'desc')) . "?sortfields=issues.{$key}=asc", __('Show details'), array('class' => 'button button-silver dash', 'title' => __('Show more issues')));
}
?>
<br style="clear: both;">
示例10: image_tag
if ($include_buttons) {
?>
<div class="settings_container">
<?php
echo image_tag('icon-mono-settings.png', array('class' => 'dropper dropdown_link'));
?>
<ul class="popup_box milestone_moreactions more_actions_dropdown" id="milestone_<?php
echo $milestone->getID();
?>
_moreactions" style="display: none;">
<li><?php
echo link_tag(make_url('project_milestone_details', array('project_key' => $milestone->getProject()->getKey(), 'milestone_id' => $milestone->getID())), __('Show overview'));
?>
</li>
<?php
if ($tbg_user->canEditProjectDetails(\thebuggenie\core\framework\Context::getCurrentProject())) {
?>
<li class="separator"></li>
<li><?php
echo javascript_link_tag(__('Mark as finished'), array('onclick' => "TBG.Main.Helpers.Backdrop.show('" . make_url('get_partial_for_backdrop', array('key' => 'milestone_finish', 'project_id' => $milestone->getProject()->getId(), 'milestone_id' => $milestone->getID(), 'board_id' => isset($board) ? $board->getID() : '')) . "');"));
?>
</li>
<li class="separator"></li>
<li><?php
echo javascript_link_tag(__('Edit'), array('onclick' => "TBG.Main.Helpers.Backdrop.show('" . make_url('get_partial_for_backdrop', array('key' => 'agilemilestone', 'project_id' => $milestone->getProject()->getId(), 'milestone_id' => $milestone->getID(), 'board_id' => isset($board) ? $board->getID() : '')) . "');"));
?>
</li>
<li><?php
if (isset($board)) {
switch ($board->getType()) {
case AgileBoard::TYPE_GENERIC:
示例11: componentSpecialAllTemplates
public function componentSpecialAllTemplates()
{
$this->articles = Articles::getTable()->getAllTemplates(framework\Context::getCurrentProject());
}
示例12: runProjectIssueCommitsMore
public function runProjectIssueCommitsMore(framework\Request $request)
{
$this->forward403unless($request->isPost());
$this->selected_project = Project::getByKey($request['project_key']);
framework\Context::setCurrentProject($this->selected_project);
if (framework\Context::getModule('vcs_integration')->getSetting('vcs_mode_' . framework\Context::getCurrentProject()->getID()) == Vcs_integration::MODE_DISABLED) {
return $this->return404(framework\Context::getI18n()->__('VCS Integration has been disabled for this project'));
}
$issue = Issues::getTable()->getByProjectIDAndIssueNo($this->selected_project->getID(), $request['issue_no']);
$links = IssueLink::getCommitsByIssue($issue, $request->getParameter('limit', 0), $request->getParameter('offset', 0));
return $this->renderJSON(array('content' => $this->getComponentHTML('vcs_integration/issuecommits', array("projectId" => $this->selected_project->getID(), "links" => $links))));
}
示例13: link_tag
echo link_tag(make_url('publish_article', array('article_name' => "OpenidIntro")), __('OpenID login introduction header'), array('title' => "OpenidIntro"));
?>
</li>
<li><?php
echo link_tag(make_url('publish_article', array('article_name' => "RegistrationIntro")), __('Registration introduction header'), array('title' => "RegistrationIntro"));
?>
</li>
<li><?php
echo link_tag(make_url('publish_article', array('article_name' => "ForgottenPasswordIntro")), __('Forgotten password introduction header'), array('title' => "ForgottenPasswordIntro"));
?>
</li>
<?php
} else {
?>
<li><?php
echo link_tag(make_url('publish_article', array('article_name' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey() . ":MainPage")), __('Project wiki frontpage'), array('title' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey() . ":MainPage"));
?>
</li>
<?php
}
?>
</ul>
<br style="clear: both;">
<br style="clear: both;">
<h3><?php
echo __('Wiki maintenance');
?>
</h3>
<ul class="category_list">
<li><?php
echo link_tag(make_url('publish_article', array('article_name' => "Special:{$projectnamespace}DeadEndPages")), __('Dead end pages'), array('title' => "Special:{$projectnamespace}DeadEndPages"));
示例14: foreach
$milestone_cc = 0;
foreach (\thebuggenie\core\framework\Context::getCurrentProject()->getUpcomingMilestones(21) as $milestone) {
?>
<?php
if ($milestone->isScheduled()) {
?>
<?php
include_component('main/milestonedashboardbox', array('milestone' => $milestone));
?>
<?php
$milestone_cc++;
?>
<?php
}
}
foreach (\thebuggenie\core\framework\Context::getCurrentProject()->getStartingMilestones(21) as $milestone) {
?>
<?php
if ($milestone->isStarting()) {
?>
<?php
include_component('main/milestonedashboardbox', array('milestone' => $milestone));
?>
<?php
$milestone_cc++;
?>
<?php
}
}
?>
</div>
示例15: listen_viewissue_panel
public function listen_viewissue_panel(framework\Event $event)
{
if (framework\Context::getModule('vcs_integration')->getSetting('vcs_mode_' . framework\Context::getCurrentProject()->getID()) == self::MODE_DISABLED) {
return;
}
$links = IssueLink::getCommitsByIssue($event->getSubject());
include_component('vcs_integration/viewissue_commits', array('links' => $links, 'projectId' => $event->getSubject()->getProject()->getID()));
}