public function componentPagination()
 {
     $this->currentpage = ceil($this->offset / $this->ipp) + 1;
     $this->pagecount = ceil($this->resultcount / $this->ipp);
     $parameters = array();
     foreach ($this->filters as $key => $filter) {
         if (is_array($filter)) {
             foreach ($filter as $subkey => $subfilter) {
                 if (is_array($subfilter)) {
                     foreach ($subfilter as $subsubkey => $subsubfilter) {
                         $parameters[] = "filters[{$key}][{$subkey}][{$subsubkey}]=" . urlencode($subsubfilter);
                     }
                 } else {
                     $parameters[] = "filters[{$key}][{$subkey}]=" . urlencode($subfilter);
                 }
             }
         } else {
             $parameters[] = "filters[{$key}]=" . urlencode($filter);
         }
     }
     $parameters[] = 'template=' . $this->templatename;
     $parameters[] = 'template_parameter=' . $this->template_parameter;
     $parameters[] = 'searchterm=' . $this->searchterm;
     $parameters[] = 'groupby=' . $this->groupby;
     $parameters[] = 'grouporder=' . $this->grouporder;
     $parameters[] = 'issues_per_page=' . $this->ipp;
     $route = TBGContext::isProjectContext() ? TBGContext::getRouting()->generate('project_search_paginated', array('project_key' => TBGContext::getCurrentProject()->getKey())) : TBGContext::getRouting()->generate('search_paginated');
     $this->route = $route;
     $this->parameters = join('&', $parameters);
 }
 public function componentLeftmenu()
 {
     $this->show_article_options = (bool) ($this->article instanceof TBGWikiArticle);
     $this->links_target_id = TBGContext::isProjectContext() ? TBGContext::getCurrentProject()->getID() : 0;
     $this->links = TBGPublish::getModule()->getMenuItems($this->links_target_id);
     $this->user_drafts = TBGPublish::getModule()->getUserDrafts();
     $this->whatlinkshere = $this->article instanceof TBGWikiArticle ? $this->article->getLinkingArticles() : null;
 }
Esempio n. 3
0
 public function runProjectCommits(TBGRequest $request)
 {
     $this->selected_project = TBGProject::getByKey($request['project_key']);
     TBGContext::setCurrentProject($this->selected_project);
     if (TBGContext::getModule('vcs_integration')->getSetting('vcs_mode_' . TBGContext::getCurrentProject()->getID()) == TBGVCSIntegration::MODE_DISABLED) {
         return $this->return404(TBGContext::getI18n()->__('VCS Integration has been disabled for this project'));
     }
     $offset = $request->getParameter('offset', 0);
     $this->commits = TBGVCSIntegrationCommit::getByProject($this->selected_project->getID(), 40, $offset);
     if ($offset) {
         return $this->renderJSON(array('content' => $this->getTemplateHTML('vcs_integration/projectcommits', array('commits' => $this->commits, 'selected_project' => $this->selected_project)), 'offset' => $offset + 40));
     }
 }
Esempio n. 4
0
    ?>
</div>
												<?php 
    echo link_tag(make_url('my_reported_issues'), image_tag('icon_savedsearch.png') . __('Issues reported by me'));
    ?>
												<?php 
    echo link_tag(make_url('my_assigned_issues'), image_tag('icon_savedsearch.png') . __('Open issues assigned to me'));
    ?>
												<?php 
    echo link_tag(make_url('my_teams_assigned_issues'), image_tag('icon_savedsearch.png') . __('Open issues assigned to my teams'));
    ?>
												<?php 
    foreach ($tbg_user->getStarredIssues() as $issue) {
        ?>
													<?php 
        if (!TBGContext::isProjectContext() || $issue->getProject()->getID() != TBGContext::getCurrentProject()->getID()) {
            continue;
        }
        ?>
													<?php 
        $link_text = image_tag('star_small.png');
        if ($issue->isBlocking()) {
            $link_text .= image_tag('icon_important.png', array('style' => 'margin-right: 5px;', 'title' => __('This issue is blocking the next release')));
        }
        $link_text .= $issue->getIssueType()->getName() . ' ' . $issue->getFormattedIssueNo(true) . '<br>';
        $link_text .= strlen($issue->getTitle()) > 43 ? substr($issue->getTitle(), 0, 40) . '...' : $issue->getTitle();
        $classes = $issue->isClosed() ? 'issue_closed' : '';
        ?>
													<?php 
        echo link_tag(make_url('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo())), $link_text, array('class' => $classes));
        ?>
	<?php 
    echo link_tag($menuitem['url'], $menuitem['title'], array('title' => $menuitem['title']));
}
if ($tbg_user->canEditProjectDetails($selected_project)) {
    ?>
	<?php 
    if ($selected_project->isBuildsEnabled()) {
        ?>
		<?php 
        echo link_tag(make_url('project_release_center', array('project_key' => TBGContext::getCurrentProject()->getKey())), __('Release center'), $tbg_response->getPage() == 'project_release_center' ? array('class' => 'selected') : array());
        ?>
	<?php 
    }
    ?>
	<?php 
    echo link_tag(make_url('project_settings', array('project_key' => TBGContext::getCurrentProject()->getKey())), __('Settings'), $tbg_response->getPage() == 'project_settings' ? array('class' => 'selected') : array());
    ?>
	<?php 
    if (!$submenu && $tbg_response->getPage() == 'project_settings') {
        ?>
		<?php 
        if (!isset($selected_tab)) {
            $selected_tab = 'info';
        }
        ?>
		<ul class="simple_list" id="project_config_menu">
			<li id="tab_information"<?php 
        if ($selected_tab == 'info') {
            ?>
 class="selected"<?php 
        }
<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;">
			<?php 
if (TBGContext::isProjectContext()) {
    ?>
				<?php 
    echo __('Note: This page lists all articles for "%project_name". For a list of global articles, see %all_pages', array('%project_name' => TBGContext::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_template('publish/articleslist', compact('articles'));
?>
</div>
	<ShortName><?php 
echo TBGContext::isProjectContext() ? __('%project_name% search', array('%project_name%' => TBGContext::getCurrentProject()->getName())) : __('%site_name% search', array('%site_name%' => TBGSettings::getTBGname()));
?>
</ShortName>
	<LongName><?php 
echo TBGContext::isProjectContext() ? __('%project_name% search', array('%project_name%' => TBGContext::getCurrentProject()->getName())) : __('%site_name% search', array('%site_name%' => TBGSettings::getTBGname()));
?>
</LongName>
	<Description><?php 
echo TBGContext::isProjectContext() ? __('%project_name% search', array('%project_name%' => TBGContext::getCurrentProject()->getName())) : __('%site_name% search', array('%site_name%' => TBGSettings::getTBGname()));
?>
</Description>
	<Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAIgAAACIBB7P0uQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAKISURBVDiNpZNPiE1xFMc%2F5%2F7ufX%2B853nzZh6G%2BYPBaESDovxPilKabEhZsJOFLBRjITuFiAULkqRYsLAxooiEGAzR%2BPcmRmP8mWnejDf3vXfvu8fmjaiRhbM5ncX5dL6n71dUlf8p%2B%2FehslIS8cnsTFRS7%2FuUst94le3mTi6nT%2F8JmFgv06Yv42Zjc3pqQ%2FUikukw99tv8LZj0E1OkmMDPdo6GsACEJFQopozk2Yyta7JZt2aDbif6tm19ShzlkWiTYvZm0zL7r8CQlFaYklWhmNQ1M8MeZ1s2bSNh239LF64lJomqJnDAceRFaMCii4NhWHwCqDAs54T9FlX0bGv6Xj%2BmHQdjK8jWlHNcRGpEBH5BRCRFOBlv8BALwwPQXbI5dabVqzG03TcHSA%2FBJGxEK9iLrAf2CcizSNPXOc4TktvxuscN4FZ8RTYIfB9sG2YvxYuH4aqGiAAYDmQBw4B2Kp6XkR6ReRs1xP1bAfHL0B6CsTGQSEPue9hd%2Fa0RWKnXtrFxr7Zve%2FMtVKp5IhIkbKRDDADOBaK0N2wAF3Ygi7dTBCvsPpOXWjVN59v65Hr03XHGYJYwr4CbATMiA8U6AcuFfN0vW9nfXcnlV6e2rmrgtTX6EXaug5ixgREoogJ%2BV40Gl3iuu5lG0BVAxH5AfQBMcAr5qg1xoQsUyLTlaHjFNnBTH3MC3%2FoH%2FyOgjsfaEZVR2RsB9oSicRJYDNw1hhzXyxexFN8C0dsf8%2B5ZH7eatqADUAjYOT3MImIKV%2BQBmqBfZZleUEQ3AMmWDY%2FAp%2FXwAMgo6reH2FS1VJZig8MA4%2BMMZkgCLoBO%2FDJAT3AR1X1AGS0OJedZgMOECl3gAKQA3wtL%2F4EbzL%2FhCjT%2FIEAAAAASUVORK5CYII%3D</Image>
	<Url type="text/html" template="<?php 
echo TBGContext::isProjectContext() ? make_url('project_issues', array('project_key' => TBGContext::getCurrentProject()->getKey()), false) : make_url('search', array(), false);
?>
?filters[text][operator]=%3A&amp;filters[text][value]={searchTerms}"/>
	<Url type="application/x-suggestions+json" template="<?php 
echo TBGContext::isProjectContext() ? make_url('project_quicksearch', array('project_key' => TBGContext::getCurrentProject()->getKey(), 'format' => 'json'), false) : make_url('quicksearch', array('format' => 'json'), false);
?>
?filters[text][operator]=%3A&amp;filters[text][value]={searchTerms}"/>
	<AdultContent>false</AdultContent>
	<OutputEncoding><?php 
echo TBGContext::getI18n()->getCharset();
?>
</OutputEncoding>
	<Contact>support@thebuggenie.com</Contact>
	<Query role="example" searchTerms="opensearch"/>
	<Attribution>No copyright</Attribution>
	<SyndicationRight>open</SyndicationRight>
</OpenSearchDescription>
 public function componentSpecialAllTemplates()
 {
     $this->articles = TBGArticlesTable::getTable()->getAllTemplates(TBGContext::getCurrentProject());
 }
Esempio n. 9
0
			<?php 
        }
        ?>
		<?php 
    }
    ?>
		<?php 
    if ($resultcount - $cc > 0) {
        ?>
			<li class="find_more_issues last">
				<span class="informal"><?php 
        echo __('See %num more issues ...', array('%num' => $resultcount - $cc));
        ?>
</span>
				<div class="hidden url"><?php 
        echo TBGContext::isProjectContext() ? make_url('project_issues', array('project_key' => TBGContext::getCurrentProject()->getKey())) : make_url('search');
        ?>
?fs[text][v]=<?php 
        echo $searchterm;
        ?>
&fs[text][o]=<?php 
        echo urlencode('=');
        ?>
</div>
			</li>
		<?php 
    }
    ?>
	<?php 
} else {
    ?>
Esempio n. 10
0
<?php

$article_name = isset($article_name) ? $article_name : '';
if (!TBGContext::isProjectContext() || TBGContext::isProjectContext() && mb_strtolower($article_name) != mb_strtolower(TBGContext::getCurrentProject()->getKey() . ':mainpage')) {
    if (TBGContext::isProjectContext()) {
        $tbg_response->addBreadcrumb(TBGPublish::getModule()->getMenuTitle(), make_url('publish_article', array('article_name' => TBGContext::getCurrentProject()->getKey() . ':MainPage')), tbg_get_breadcrumblinks('project_summary', TBGContext::getCurrentProject()));
    } else {
        $tbg_response->addBreadcrumb(TBGPublish::getModule()->getMenuTitle(), make_url('publish_article', array('article_name' => 'MainPage')), tbg_get_breadcrumblinks('main_links'));
    }
    $items = explode(':', $article_name);
    $bcpath = array_shift($items);
    if (mb_strtolower($bcpath) == 'category') {
        $tbg_response->addBreadcrumb(__('Categories'));
        if (TBGContext::isProjectContext()) {
            $bcpath .= ":" . array_shift($items);
        }
    } elseif (!TBGContext::isProjectContext() && mb_strtolower($bcpath) != 'mainpage') {
        $tbg_response->addBreadcrumb($bcpath, make_url('publish_article', array('article_name' => $bcpath)));
    }
    foreach ($items as $bc_name) {
        $bcpath .= ":" . $bc_name;
        $tbg_response->addBreadcrumb($bc_name, make_url('publish_article', array('article_name' => $bcpath)));
    }
} else {
    $tbg_response->addBreadcrumb(TBGPublish::getModule()->getMenuTitle(), make_url('publish_article', array('article_name' => TBGContext::getCurrentProject()->getKey() . ':MainPage')), tbg_get_breadcrumblinks('project_summary', TBGContext::getCurrentProject()));
}
Esempio n. 11
0
<?php

/*
 * Generate link for browser
 */
$link_repo = TBGContext::getModule('vcs_integration')->getSetting('browser_url_' . TBGContext::getCurrentProject()->getID());
if (TBGContext::getModule('vcs_integration')->getSetting('vcs_mode_' . TBGContext::getCurrentProject()->getID()) != TBGVCSIntegration::MODE_DISABLED) {
    echo link_tag(make_url('vcs_commitspage', array('project_key' => TBGContext::getCurrentProject()->getKey())), __('Commits'), $tbg_response->getPage() == 'vcs_commitspage' ? array('class' => 'selected') : array());
    if (!$submenu && $tbg_response->getPage() == 'vcs_commitspage') {
        ?>
			<ul class="simple_list">
				<li><a href="<?php 
        echo $link_repo;
        ?>
" target="_blank"><?php 
        echo __('Browse source code');
        ?>
</a></li>
			</ul>
		<?php 
    }
}
<div class="article">
	<div class="header">Special:<?php 
echo $projectnamespace != '' ? "<span class='faded_out'>{$projectnamespace}</span>" : '';
?>
Uncategorized Categories</div>
	<?php 
if (TBGContext::isProjectContext()) {
    ?>
		<div class="greybox" style="margin: 15px;">
			<?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' => TBGContext::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_template('publish/articleslist', array('articles' => $articles, 'include_redirects' => false));
?>
</div>
 public function componentBuild()
 {
     if (!isset($this->build)) {
         $this->build = new TBGBuild();
         $this->build->setProject(TBGContext::getCurrentProject());
         $this->build->setName(TBGContext::getI18n()->__('%project_name version 0.0.0', array('%project_name' => $this->project->getName())));
         if (TBGContext::getRequest()->getParameter('edition_id') && ($edition = TBGContext::factory()->TBGEdition(TBGContext::getRequest()->getParameter('edition_id')))) {
             $this->build->setEdition($edition);
         }
     }
 }
Esempio n. 14
0
    echo $mode;
    ?>
" class="focusable" onchange="TBG.Search.bulkChanger('<?php 
    echo $mode;
    ?>
'); if ($(this).getValue() == 'new') { ['bulk_action_assign_milestone_top_name', 'bulk_action_assign_milestone_bottom_name'].each(function(element) { $(element).show(); }); } else { ['bulk_action_assign_milestone_top_name', 'bulk_action_assign_milestone_bottom_name'].each(function(element) { $(element).hide(); }); }">
						<option value="0"><?php 
    echo __('No milestone');
    ?>
</option>
						<option value="new"><?php 
    echo __('Create new milestone from selected issues');
    ?>
</option>
						<?php 
    foreach (TBGContext::getCurrentProject()->getMilestonesForIssues() as $milestone_id => $milestone) {
        ?>
							<option id="bulk_action_assign_milestone_<?php 
        echo $mode;
        ?>
_<?php 
        echo $milestone_id;
        ?>
" value="<?php 
        echo $milestone_id;
        ?>
"><?php 
        echo $milestone->getName();
        ?>
</option>
						<?php 
Esempio n. 15
0
 /**
  *
  * @param \b2db\Criteria $crit
  * @param array|TBGSearchFilter $filters
  * @param \b2db\Criterion $ctn
  * @return null
  */
 public function addToCriteria($crit, $filters, $ctn = null)
 {
     $filter_key = $this->getFilterKey();
     if (in_array($this['operator'], array('=', '!=', '<=', '>=', '<', '>'))) {
         if ($filter_key == 'text') {
             if ($this['value'] != '') {
                 $searchterm = mb_strpos($this['value'], '%') !== false ? $this['value'] : "%{$this['value']}%";
                 if ($this['operator'] == '=') {
                     if ($ctn === null) {
                         $ctn = $crit->returnCriterion(TBGIssuesTable::TITLE, $searchterm, Criteria::DB_LIKE);
                     }
                     $ctn->addOr(TBGIssuesTable::DESCRIPTION, $searchterm, Criteria::DB_LIKE);
                     $ctn->addOr(TBGIssuesTable::REPRODUCTION_STEPS, $searchterm, Criteria::DB_LIKE);
                     $ctn->addOr(TBGIssueCustomFieldsTable::OPTION_VALUE, $searchterm, Criteria::DB_LIKE);
                 } else {
                     if ($ctn === null) {
                         $ctn = $crit->returnCriterion(TBGIssuesTable::TITLE, $searchterm, Criteria::DB_NOT_LIKE);
                     }
                     $ctn->addWhere(TBGIssuesTable::DESCRIPTION, $searchterm, Criteria::DB_NOT_LIKE);
                     $ctn->addWhere(TBGIssuesTable::REPRODUCTION_STEPS, $searchterm, Criteria::DB_NOT_LIKE);
                     $ctn->addOr(TBGIssueCustomFieldsTable::OPTION_VALUE, $searchterm, Criteria::DB_NOT_LIKE);
                 }
                 return $ctn;
             }
         } elseif (in_array($filter_key, self::getValidSearchFilters())) {
             if ($filter_key == 'subprojects') {
                 if (TBGContext::isProjectContext()) {
                     if ($ctn === null) {
                         $ctn = $crit->returnCriterion(TBGIssuesTable::PROJECT_ID, TBGContext::getCurrentProject()->getID());
                     }
                     if ($this->hasValue()) {
                         foreach ($this->getValues() as $value) {
                             switch ($value) {
                                 case 'all':
                                     $subprojects = TBGProject::getIncludingAllSubprojectsAsArray(TBGContext::getCurrentProject());
                                     foreach ($subprojects as $subproject) {
                                         if ($subproject->getID() == TBGContext::getCurrentProject()->getID()) {
                                             continue;
                                         }
                                         $ctn->addOr(TBGIssuesTable::PROJECT_ID, $subproject->getID());
                                     }
                                     break;
                                 case 'none':
                                 case '':
                                     break;
                                 default:
                                     $ctn->addOr(TBGIssuesTable::PROJECT_ID, (int) $value);
                                     break;
                             }
                         }
                     }
                     return $ctn;
                 }
             } elseif (in_array($filter_key, array('build', 'edition', 'component'))) {
                 switch ($filter_key) {
                     case 'component':
                         $tbl = TBGIssueAffectsComponentTable::getTable();
                         $fk = TBGIssueAffectsComponentTable::ISSUE;
                         break;
                     case 'edition':
                         $tbl = TBGIssueAffectsEditionTable::getTable();
                         $fk = TBGIssueAffectsEditionTable::ISSUE;
                         break;
                     case 'build':
                         $tbl = TBGIssueAffectsBuildTable::getTable();
                         $fk = TBGIssueAffectsBuildTable::ISSUE;
                         break;
                 }
                 $crit->addJoin($tbl, $fk, TBGIssuesTable::ID, array(array($tbl->getB2DBAlias() . '.' . $filter_key, $this->getValues())), \b2db\Criteria::DB_INNER_JOIN);
                 return null;
             } else {
                 if ($filter_key == 'project_id' && in_array('subprojects', $filters)) {
                     return null;
                 }
                 $values = $this->getValues();
                 $num_values = 0;
                 if ($filter_key == 'status') {
                     if ($this->hasValue('open')) {
                         $c = $crit->returnCriterion(TBGIssuesTable::STATE, TBGIssue::STATE_OPEN);
                         $num_values++;
                     }
                     if ($this->hasValue('closed')) {
                         $num_values++;
                         if (isset($c)) {
                             $c->addWhere(TBGIssuesTable::STATE, TBGIssue::STATE_CLOSED);
                         } else {
                             $c = $crit->returnCriterion(TBGIssuesTable::STATE, TBGIssue::STATE_CLOSED);
                         }
                     }
                     if (isset($c)) {
                         if (count($values) == $num_values) {
                             return $c;
                         } else {
                             $crit->addWhere($c);
                         }
                     }
                 }
                 $dbname = TBGIssuesTable::getTable()->getB2DBName();
                 foreach ($values as $value) {
                     $operator = $this['operator'];
                     $or = true;
                     if ($filter_key == 'status' && in_array($value, array('open', 'closed'))) {
                         continue;
                     } else {
                         $field = $dbname . '.' . $filter_key;
                         if ($operator == '!=' || in_array($filter_key, array('posted', 'last_updated'))) {
                             $or = false;
                         }
                     }
                     if ($ctn === null) {
                         $ctn = $crit->returnCriterion($field, $value, urldecode($operator));
                     } elseif ($or) {
                         $ctn->addOr($field, $value, urldecode($operator));
                     } else {
                         $ctn->addWhere($field, $value, urldecode($operator));
                     }
                 }
                 return $ctn;
             }
         } elseif (TBGCustomDatatype::doesKeyExist($filter_key)) {
             $customdatatype = TBGCustomDatatype::getByKey($filter_key);
             if (in_array($this->getFilterType(), TBGCustomDatatype::getInternalChoiceFieldsAsArray())) {
                 $tbl = clone TBGIssueCustomFieldsTable::getTable();
                 $crit->addJoin($tbl, TBGIssueCustomFieldsTable::ISSUE_ID, TBGIssuesTable::ID, array(array($tbl->getB2DBAlias() . '.customfields_id', $customdatatype->getID()), array($tbl->getB2DBAlias() . '.customfieldoption_id', $this->getValues())), \b2db\Criteria::DB_INNER_JOIN);
                 return null;
             } else {
                 foreach ($this->getValues() as $value) {
                     if ($customdatatype->hasCustomOptions()) {
                         if ($ctn === null) {
                             $ctn = $crit->returnCriterion(TBGIssueCustomFieldsTable::CUSTOMFIELDS_ID, $customdatatype->getID());
                             $ctn->addWhere(TBGIssueCustomFieldsTable::CUSTOMFIELDOPTION_ID, $value, $this['operator']);
                         } else {
                             $ctn->addOr(TBGIssueCustomFieldsTable::CUSTOMFIELDOPTION_ID, $value, $this['operator']);
                         }
                     } else {
                         if ($ctn === null) {
                             $ctn = $crit->returnCriterion(TBGIssueCustomFieldsTable::CUSTOMFIELDS_ID, $customdatatype->getID());
                             $ctn->addWhere(TBGIssueCustomFieldsTable::OPTION_VALUE, $value, $this['operator']);
                         } else {
                             $ctn->addOr(TBGIssueCustomFieldsTable::OPTION_VALUE, $value, $this['operator']);
                         }
                     }
                 }
                 return $ctn;
             }
         }
     }
 }
<div class="article">
	<div class="header">Special:<?php 
echo $projectnamespace != '' ? "<span class='faded_out'>{$projectnamespace}</span>" : '';
?>
Dead End Pages</div>
	<?php 
if (TBGContext::isProjectContext()) {
    ?>
		<div class="greybox" style="margin: 15px;">
			<?php 
    echo __('Note: This page lists all dead end articles for "%project_name". For a list of global articles with no links, see %dead_end_pages', array('%project_name' => TBGContext::getCurrentProject()->getName(), '%dead_end_pages' => link_tag(make_url('publish_article', array('article_name' => "Special:DeadEndPages")), 'Special:DeadEndPages')));
    ?>
		</div>
	<?php 
}
?>
	<p>
		<?php 
echo __('Below is a listing of all pages that has no links to other pages.');
?>
	</p>
	<?php 
include_template('publish/articleslist', array('articles' => $articles, 'include_redirects' => false));
?>
</div>
	<?php 
} else {
    ?>
		<h4>
			<div class="button button-green" style="float: right;" onclick="TBG.Main.Helpers.Backdrop.show('<?php 
    echo make_url('get_partial_for_backdrop', array('key' => 'mailing_editincomingemailaccount', 'project_id' => $project->getId()));
    ?>
');"><?php 
    echo __('Add new account');
    ?>
</div>
			<?php 
    echo __('Incoming email accounts');
    ?>
		</h4>
		<div id="mailing_incoming_accounts">
			<?php 
    foreach (TBGContext::getModule('mailing')->getIncomingEmailAccountsForProject(TBGContext::getCurrentProject()) as $account) {
        ?>
				<?php 
        include_template('mailing/incomingemailaccount', array('account' => $account));
        ?>
			<?php 
    }
    ?>
		</div>
	<?php 
}
?>
</div>
<li class="searchterm"><?php 
echo $searchterm;
?>
<br><span class="informal"><?php 
echo __('Select this to search the wiki for this term');
?>
</span><span class="url informal"><?php 
echo TBGContext::isProjectContext() ? make_url('publish_find_project_articles', array('project_key' => TBGContext::getCurrentProject()->getKey(), 'articlename' => $searchterm)) : make_url('publish_find_articles', array('articlename' => $searchterm));
?>
</span></li>
Esempio n. 19
0
 public function runReleaseCenter(TBGRequest $request)
 {
     $this->forward403if(TBGContext::getCurrentProject()->isArchived() || !$this->getUser()->canManageProjectReleases(TBGContext::getCurrentProject()));
     $this->build_error = TBGContext::getMessageAndClear('build_error');
     $this->_setupBuilds();
 }
Esempio n. 20
0
 public function extractIssues($matches)
 {
     $issue = TBGIssue::getIssueFromLink($matches[0]);
     if ($issue instanceof TBGIssue) {
         if (!TBGContext::isProjectContext() || TBGContext::isProjectContext() && $issue->getProjectID() == TBGContext::getCurrentProject()->getID()) {
             $this->foundissues[$issue->getID()] = $issue;
             $this->resultcount++;
         }
     }
 }
<?php

$tbg_response->addBreadcrumb(__('Report an issue'), make_url('project_reportissue', array('project_key' => TBGContext::getCurrentProject()->getKey())), tbg_get_breadcrumblinks('project_summary', TBGContext::getCurrentProject()));
$tbg_response->setTitle(__('Report an issue'));
$tbg_response->addJavascript('reportissue.js');
if (TBGContext::getCurrentProject()->isLocked() == true) {
    ?>
      <div class="rounded_box red borderless" id="notfound_error">
      		<div class="viewissue_info_header"><?php 
    echo __("Reporting disabled");
    ?>
</div>
      		<div class="viewissue_info_content">
      			<?php 
    if (isset($message) && $message) {
        ?>
      				<?php 
        echo $message;
        ?>
      			<?php 
    } else {
        ?>
      				<?php 
        echo __("The administrator has disabled reporting issues for this project");
        ?>
      			<?php 
    }
    ?>
      		</div>
      	</div>
      </div>
 /**
  * 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 (TBGContext::isProjectContext()) {
         $this->namespace = TBGContext::getCurrentProject()->getKey();
     }
     if (!TBGContext::isCLI()) {
         TBGContext::loadLibrary('ui');
     }
 }
Esempio n. 23
0
						<?php 
        echo link_tag(make_url('client_dashboard', array('client_id' => $client->getID())), image_tag('tab_clients.png') . $client->getName());
        ?>
					<?php 
    }
    ?>
				</div>
			</li>
		<?php 
}
?>
		<?php 
TBGEvent::createNew('core', 'menustrip_item_links', null, array('selected_tab' => $tbg_response->getPage()))->trigger();
?>
	</ul>
	<?php 
if (TBGContext::isProjectContext() && !TBGContext::getCurrentProject()->isArchived() && !TBGContext::getCurrentProject()->isLocked() && ($tbg_user->canReportIssues() || $tbg_user->canReportIssues(TBGContext::getCurrentProject()->getID()))) {
    ?>
		<div class="reportissue_button_container">
			<?php 
    echo javascript_link_tag(image_tag('icon-mono-add.png') . __('Report an issue'), array('onclick' => "TBG.Main.Helpers.Backdrop.show('" . make_url('get_partial_for_backdrop', array('key' => 'reportissue', 'project_id' => TBGContext::getCurrentProject()->getId())) . "');", 'class' => 'button button-lightblue'));
    ?>
		</div>
	<?php 
}
?>
	<?php 
TBGEvent::createNew('core', 'before_header_userinfo')->trigger();
?>
</nav>
Esempio n. 24
0
					<?php 
    echo link_tag(make_url('publish_special_whatlinkshere', array('linked_article_name' => $article_name)), __('What links here'));
    ?>
				</li>
			<?php 
}
?>
			<?php 
if (TBGContext::isProjectContext()) {
    ?>
				<li>
					<?php 
    echo image_tag('news_item.png', array('style' => 'float: left;'), false, 'publish');
    ?>
					<?php 
    echo link_tag(make_url('publish_article', array('article_name' => 'Special:' . ucfirst(mb_strtolower(TBGContext::getCurrentProject()->getKey())) . ':SpecialPages')), __('Project special pages'));
    ?>
				</li>
			<?php 
}
?>
			<li>
				<?php 
echo image_tag('news_item.png', array('style' => 'float: left;'), false, 'publish');
?>
				<?php 
echo link_tag(make_url('publish_article', array('article_name' => 'Special:SpecialPages')), __('Special pages'));
?>
			</li>
		</ul>
	</div>
Esempio n. 25
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);
 }
Esempio n. 26
0
</button>
						<?php 
    }
    ?>
					</h4>
					<?php 
    include_template('publish/attachments', array('article' => $article, 'attachments' => $attachments));
    ?>
				</div>
				<div id="article_comments">
					<h4>
						<?php 
    echo __('Article comments (%count)', array('%count' => TBGComment::countComments($article->getID(), TBGComment::TYPE_ARTICLE)));
    ?>
						<?php 
    if ($tbg_user->canPostComments() && (TBGContext::isProjectContext() && !TBGContext::getCurrentProject()->isArchived() || !TBGContext::isProjectContext())) {
        ?>
							<button id="comment_add_button" class="button button-silver" onclick="TBG.Main.Comment.showPost();"><?php 
        echo __('Post comment');
        ?>
</button>
						<?php 
    }
    ?>
					</h4>
					<?php 
    include_template('main/comments', array('target_id' => $article->getID(), 'mentionable_target_type' => 'article', 'target_type' => TBGComment::TYPE_ARTICLE, 'show_button' => false, 'comment_count_div' => 'article_comment_count', 'forward_url' => make_url('publish_article', array('article_name' => $article->getName()))));
    ?>
				</div>
			<?php 
}
	<ul class="project_list simple_list" style="margin: 0;">
	<?php 
    foreach ($subprojects as $project) {
        ?>
		<li style="width: 100%; font-size: 1.1em; margin-top: 0;"><?php 
        include_component('project/overview', array('project' => $project));
        ?>
</li>
	<?php 
    }
    ?>
	</ul>
<?php 
} else {
    ?>
	<div class="faded_out" style="font-weight: normal;"><?php 
    echo __('This project has no subprojects');
    ?>
</div>
<?php 
}
?>
<a href="javascript:void(0);" class="button button-silver dash" onclick="TBG.Main.Helpers.Backdrop.show('<?php 
echo make_url('get_partial_for_backdrop', array('key' => 'project_archived_projects', 'pid' => TBGContext::getCurrentProject()->getID()));
?>
');"><?php 
echo __('View archived subprojects');
?>
</a>
<br style="clear: both;">
Esempio n. 28
0
?>
" onsubmit="TBG.Project.Planning.updateIssues('<?php 
echo make_url('project_planning_update_milestone_issues', array('project_key' => $milestone->getProject()->getKey(), 'milestone_id' => $milestone->getID()));
?>
', <?php 
echo $milestone->getID();
?>
);return false;" method="post" id="milestone_<?php 
echo $milestone->getID();
?>
_issues_form">
			<table cellpadding="0" cellspacing="0" class="milestone_issues">
				<thead>
					<tr>
						<?php 
if ($tbg_user->canEditProjectDetails(TBGContext::getCurrentProject())) {
    ?>
							<th class="nosort" style="width: 20px; padding: 1px !important;"><input type="checkbox" /></th>
						<?php 
}
?>
						<th><?php 
echo __('Issue');
?>
</th>
						<th><?php 
echo __('Assigned to');
?>
</th>
						<th><?php 
echo __('Status');
		<?php 
        }
        ?>
	<?php 
    }
    ?>
	<?php 
    if (true || $resultcount - $cc > 0) {
        ?>
		<li class="find_more_issues last">
			<span class="informal"><?php 
        echo __('See %num% more articles ...', array('%num%' => $resultcount - $cc));
        ?>
</span>
			<div class="hidden url"><?php 
        echo TBGContext::isProjectContext() ? make_url('publish_find_project_articles', array('project_key' => TBGContext::getCurrentProject()->getKey())) : make_url('publish_find_articles');
        ?>
?articlename=<?php 
        echo $searchterm;
        ?>
</div>
		</li>
	<?php 
    }
} else {
    ?>
	<li class="disabled no_issues_found">
		<?php 
    echo __('No articles found matching your query');
    ?>
	</li>
 public function listen_quicksearchDropdownFoundItems(TBGEvent $event)
 {
     $searchterm = $event->getSubject();
     list($resultcount, $articles) = TBGWikiArticle::findByArticleNameAndProject($searchterm, TBGContext::getCurrentProject());
     TBGActionComponent::includeTemplate('publish/quicksearch_dropdown_founditems', array('searchterm' => $searchterm, 'articles' => $articles, 'resultcount' => $resultcount));
 }