/** * Pre-execute function * * @param TBGRequest $request * @param string $action */ public function preExecute(TBGRequest $request, $action) { if (!$request->hasParameter('section')) { return; } // forward 403 if you're not allowed here if ($request->isAjaxCall() == false) { $this->forward403unless(TBGContext::getUser()->canAccessConfigurationPage()); } $this->access_level = $this->getAccessLevel($request['section'], 'core'); if (!$request->isAjaxCall()) { $this->getResponse()->setPage('config'); TBGContext::loadLibrary('ui'); $this->getResponse()->addBreadcrumb(TBGContext::getI18n()->__('Configure %thebuggenie_name', array('%thebuggenie_name' => TBGSettings::getTBGname())), TBGContext::getRouting()->generate('configure'), $this->getResponse()->getPredefinedBreadcrumbLinks('main_links')); } }
<?php $tbg_response->setTitle(__('About %sitename', array('%sitename' => TBGSettings::getTBGname()))); $tbg_response->addBreadcrumb(__('About %sitename', array('%sitename' => TBGSettings::getTBGname())), make_url('about'), tbg_get_breadcrumblinks('main_links')); ?> <div class="rounded_box borderless mediumgrey" style="margin: 10px auto 0 auto; width: 500px; padding: 5px 5px 15px 5px; font-size: 13px; text-align: center;"> <div style="text-align: left; padding: 10px;"> <h1 style="font-size: 25px; margin-bottom: 0px; padding-bottom: 3px;"> The Bug Genie <span style="font-size: 14px; font-weight: normal; color: #888;"> <?php echo __('Version %thebuggenie_version', array('%thebuggenie_version' => TBGSettings::getVersion(true))); ?> </span> </h1> <h3 style="margin-top: 0; padding-top: 0;">Beautiful issue tracking and project management</h3> <?php echo __('The Bug Genie is an issue tracking system with a strong focus on being friendly – both for regular users and power users'); ?> .<br> <br> <?php echo __('The Bug Genie follows an open development model, and is released under an open source software license called the MPL (Mozilla Public License). This license gives you the freedom to pick up the sourcecode for The Bug Genie and work with it any way you need.'); ?> <br> <br> <?php echo __('Extend, develop and change The Bug Genie in any way you want, and do whatever you want with the new piece of software (The only thing you cannot do is call your software The Bug Genie). Please do send us your modifications for inclusion in The Bug Genie.'); ?> <br> <br>
<div id="logo_container"> <?php TBGEvent::createNew('core', 'header_before_logo')->trigger(); ?> <?php $link = TBGSettings::getHeaderLink() == '' ? TBGContext::getTBGPath() : TBGSettings::getHeaderLink(); ?> <a class="logo" href="<?php print $link; ?> "><?php echo image_tag(TBGSettings::getHeaderIconUrl(), array('style' => 'max-height: 24px;'), TBGSettings::isUsingCustomHeaderIcon()); ?> </a> <div class="logo_name"><?php echo TBGSettings::getTBGname(); ?> </div> </div> <?php if (!TBGSettings::isMaintenanceModeEnabled()) { ?> <?php if (TBGEvent::createNew('core', 'header_mainmenu_decider')->trigger()->getReturnValue() !== false) { ?> <?php require THEBUGGENIE_CORE_PATH . 'templates/headermainmenu.inc.php'; ?> <?php } ?>
<url><?php echo TBGContext::getUrlHost() . TBGContext::getTBGPath() . 'header.png'; ?> </url> <?php } else { ?> <url><?php echo image_url('logo_24.png', false, null, false); ?> </url> <?php } ?> <title><?php echo TBGSettings::getTBGname() . ' ~ ' . $searchtitle; ?> </title> <link><?php echo make_url('home', array(), false); ?> </link> </image> <?php if ($issues != false) { foreach ($issues as $issue) { ?> <item> <title><?php echo $issue->getFormattedIssueNo(true) . ' - ' . strip_tags($issue->getTitle());
<?php print '<?xml version="1.0" encoding="UTF-8"?>'; ?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <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&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&filters[text][value]={searchTerms}"/> <AdultContent>false</AdultContent> <OutputEncoding><?php echo TBGContext::getI18n()->getCharset(); ?> </OutputEncoding>
public function getPredefinedBreadcrumbLinks($type, $project = null) { $i18n = TBGContext::getI18n(); $links = array(); switch ($type) { case 'main_links': $links[] = array('url' => TBGContext::getRouting()->generate('home'), 'title' => $i18n->__('Frontpage')); $links[] = array('url' => TBGContext::getRouting()->generate('dashboard'), 'title' => $i18n->__('Personal dashboard')); $links[] = array('title' => $i18n->__('Issues')); $links[] = array('title' => $i18n->__('Teams')); $links[] = array('title' => $i18n->__('Clients')); $links = TBGEvent::createNew('core', 'breadcrumb_main_links', null, array(), $links)->trigger()->getReturnList(); if (TBGContext::getUser()->canAccessConfigurationPage()) { $links[] = array('url' => make_url('configure'), 'title' => $i18n->__('Configure The Bug Genie')); } $links[] = array('url' => TBGContext::getRouting()->generate('about'), 'title' => $i18n->__('About %sitename%', array('%sitename%' => TBGSettings::getTBGname()))); $links[] = array('url' => TBGContext::getRouting()->generate('account'), 'title' => $i18n->__('Account details')); break; case 'project_summary': $links[] = array('url' => TBGContext::getRouting()->generate('project_dashboard', array('project_key' => $project->getKey())), 'title' => $i18n->__('Dashboard')); $links[] = array('url' => TBGContext::getRouting()->generate('project_scrum', array('project_key' => $project->getKey())), 'title' => $i18n->__('Sprint planning')); $links[] = array('url' => TBGContext::getRouting()->generate('project_roadmap', array('project_key' => $project->getKey())), 'title' => $i18n->__('Roadmap')); $links[] = array('url' => TBGContext::getRouting()->generate('project_team', array('project_key' => $project->getKey())), 'title' => $i18n->__('Team overview')); $links[] = array('url' => TBGContext::getRouting()->generate('project_statistics', array('project_key' => $project->getKey())), 'title' => $i18n->__('Statistics')); $links[] = array('url' => TBGContext::getRouting()->generate('project_timeline', array('project_key' => $project->getKey())), 'title' => $i18n->__('Timeline')); $links[] = array('url' => TBGContext::getRouting()->generate('project_reportissue', array('project_key' => $project->getKey())), 'title' => $i18n->__('Report an issue')); $links[] = array('url' => TBGContext::getRouting()->generate('project_issues', array('project_key' => $project->getKey())), 'title' => $i18n->__('Issues')); $links = TBGEvent::createNew('core', 'breadcrumb_project_links', null, array(), $links)->trigger()->getReturnList(); break; case 'client_list': foreach (TBGClient::getAll() as $client) { if ($client->hasAccess()) { $links[] = array('url' => TBGContext::getRouting()->generate('client_dashboard', array('client_id' => $client->getID())), 'title' => $client->getName()); } } break; case 'team_list': foreach (TBGTeam::getAll() as $team) { if ($team->hasAccess()) { $links[] = array('url' => TBGContext::getRouting()->generate('team_dashboard', array('team_id' => $team->getID())), 'title' => $team->getName()); } } break; } return $links; }
protected function _parse_variable($matches) { switch ($matches[2]) { case 'CURRENTMONTH': return date('m'); case 'CURRENTMONTHNAMEGEN': case 'CURRENTMONTHNAME': return date('F'); case 'CURRENTDAY': return date('d'); case 'CURRENTDAYNAME': return date('l'); case 'CURRENTYEAR': return date('Y'); case 'CURRENTTIME': return date('H:i'); case 'NUMBEROFARTICLES': return 0; case 'PAGENAME': return TBGContext::getResponse()->getPage(); case 'NAMESPACE': return 'None'; case 'TOC': return '{{TOC}}'; case 'SITENAME': return TBGSettings::getTBGname(); case 'SITETAGLINE': return TBGSettings::getTBGtagline(); default: return ''; } }
<?php echo image_tag('footer_logo.png'); ?> <?php echo __('%thebuggenie, <b>friendly</b> issue tracking since 2002', array('%thebuggenie' => link_tag(make_url('about'), 'The Bug Genie'))); ?> <br> <a href="http://www.opensource.org/licenses/mozilla1.1.php"><?php echo __('Read the license (MPL 1.1 only)'); ?> </a> <?php if ($tbg_user->canAccessConfigurationPage()) { ?> | <b><?php echo link_tag(make_url('configure'), __('Configure %thebuggenie_name', array('%thebuggenie_name' => TBGSettings::getTBGname()))); ?> </b> <?php } ?> <?php if (TBGContext::isDebugMode() && TBGLogging::isEnabled()) { ?> <div id="tbg___DEBUGINFO___" style="position: fixed; bottom: 0; left: 0; z-index: 100; display: none; width: 100%;"> </div> <?php echo image_tag('spinning_16.gif', array('style' => 'position: fixed; bottom: 5px; right: 23px;', 'id' => 'tbg___DEBUGINFO___indicator')); ?> <?php echo image_tag('debug_show.png', array('style' => 'position: fixed; bottom: 5px; right: 3px; cursor: pointer;', 'onclick' => "\$('tbg___DEBUGINFO___').toggle();", 'title' => 'Show debug bar'));
<url><?php echo TBGContext::getUrlHost() . TBGContext::getTBGPath() . 'header.png'; ?> </url> <?php } else { ?> <url><?php echo image_url('logo_24.png', false, null, false); ?> </url> <?php } ?> <title><?php echo TBGSettings::getTBGname() . ' ~ ' . __('%project_name% project timeline', array('%project_name%' => TBGContext::getCurrentProject()->getName())); ?> </title> <link><?php echo make_url('project_timeline', array('project_key' => TBGContext::getCurrentProject()->getKey()), false); ?> </link> </image> <?php foreach ($recent_activities as $timestamp => $activities) { foreach ($activities as $activity) { if (array_key_exists('target_type', $activity) && $activity['target_type'] == 1 && ($issue = TBGContext::factory()->TBGIssue($activity['target'])) && $issue instanceof TBGIssue) { if ($issue->isDeleted()) { continue; } ?>
?> <div class="header"><?php echo __('You are temporarily this user'); ?> </div> <?php echo link_tag(make_url('switch_back_user'), image_tag('switchuser.png') . __('Switch back to original user')); ?> <?php } ?> <?php if ($tbg_user->canAccessConfigurationPage()) { ?> <?php echo link_tag(make_url('configure'), image_tag('tab_config.png') . __('Configure %thebuggenie_name', array('%thebuggenie_name' => TBGSettings::getTBGname()))); ?> <?php } ?> <?php TBGEvent::createNew('core', 'user_dropdown_reg')->trigger(); ?> <?php echo link_tag('http://www.thebuggenie.com/help/' . TBGContext::getRouting()->getCurrentRouteName(), image_tag('help.png') . __('Help for this page'), array('id' => 'global_help_link')); ?> <a href="<?php echo make_url('logout'); ?> " onclick="<?php if (TBGSettings::isPersonaAvailable()) {
/** * Set the currently selected project * * @param TBGProject $project The project, or null if none */ public static function setCurrentProject($project) { self::getResponse()->setBreadcrumb(null); self::$_selected_project = $project; if ($project instanceof TBGProject) { $projectsubmenulinks = null; $clientsubmenulinks = null; if (count(TBGProject::getAll()) > 1) { $projectsubmenulinks = array(); foreach (TBGProject::getAll() as $existing_project) { if (!$project->hasClient() || $existing_project->hasClient() && $project->getClient()->getID() == $existing_project->getClient()->getID()) { $projectsubmenulinks[] = array('url' => self::getRouting()->generate('project_dashboard', array('project_key' => $existing_project->getKey())), 'title' => $existing_project->getName()); } } } if (self::$_selected_project->hasClient()) { $clientsubmenulinks = array(); foreach (TBGClient::getAll() as $client) { if ($client->hasAccess()) { $clientsubmenulinks[] = array('url' => self::getRouting()->generate('client_dashboard', array('client_id' => $client->getID())), 'title' => $client->getName()); } } self::setCurrentClient(self::$_selected_project->getClient()); } if (strtolower(TBGSettings::getTBGname()) != strtolower($project->getName()) || self::isClientContext()) { self::getResponse()->addBreadcrumb(TBGSettings::getTBGName(), self::getRouting()->generate('home')); if (self::isClientContext()) { self::getResponse()->addBreadcrumb(self::getCurrentClient()->getName(), self::getRouting()->generate('client_dashboard', array('client_id' => self::getCurrentClient()->getID())), $clientsubmenulinks); } } self::getResponse()->addBreadcrumb($project->getName(), self::getRouting()->generate('project_dashboard', array('project_key' => TBGContext::getCurrentProject()->getKey())), $projectsubmenulinks, 'selected_project'); } else { self::getResponse()->addBreadcrumb(TBGSettings::getTBGName(), self::getRouting()->generate('home')); } }
<table style="clear: both; width: 700px; margin-top: 5px;" class="padded_table" cellpadding=0 cellspacing=0> <tr> <td style="width: 200px;"><label for="b2_name"><?php echo __('The Bug Genie custom name'); ?> </label></td> <td style="width: auto;"><input type="text" name="<?php echo TBGSettings::SETTING_TBG_NAME; ?> " id="b2_name" value="<?php echo str_replace('"', '"', TBGSettings::getTBGname()); ?> " style="width: 100%;"<?php if ($access_level != TBGSettings::ACCESS_FULL) { ?> disabled<?php } ?> ></td> </tr> <tr> <td class="config_explanation" colspan="2"><?php echo __('This is the name appearing in the headers and several other places, usually displaying "The Bug Genie"'); ?> <i>(<?php echo __('HTML allowed'); ?> )</i></td> </tr> <tr> <td><label for="b2_tagline"><?php
public static function populateBreadcrumbs() { $childbreadcrumbs = array(); if (self::$_selected_project instanceof TBGProject) { $t = self::$_selected_project; $hierarchy_breadcrumbs = array(); $projects_processed = array(); while ($t instanceof TBGProject) { if (array_key_exists($t->getKey(), $projects_processed)) { // We have a cyclic dependency! Oh no! // If this happens, throw an exception throw new Exception(TBGContext::geti18n()->__('A loop has been found in the project heirarchy. Go to project configuration, and alter the subproject setting for this project so that this project is not a subproject of one which is a subproject of this one.')); continue; } else { $all_projects = array_merge(TBGProject::getAllRootProjects(true), TBGProject::getAllRootProjects(false)); // If this is a root project, display a list of other root projects, then t is null if (!$t->hasParent() && count($all_projects) > 1) { $itemsubmenulinks = array(); foreach ($all_projects as $child) { if (!$child->hasAccess()) { continue; } $itemsubmenulinks[] = array('url' => self::getRouting()->generate('project_dashboard', array('project_key' => $child->getKey())), 'title' => $child->getName()); } $hierarchy_breadcrumbs[] = array($t, $itemsubmenulinks); $projects_processed[$t->getKey()] = $t; $t = null; continue; } elseif (!$t->hasParent()) { $hierarchy_breadcrumbs[] = array($t, null); $projects_processed[$t->getKey()] = $t; $t = null; continue; } else { // What we want to do here is to build a list of the children of the parent unless we are the only one $parent = $t->getParent(); $children = $parent->getChildren(); $itemsubmenulinks = null; if ($parent->hasChildren() && count($children) > 1) { $itemsubmenulinks = array(); foreach ($children as $child) { if (!$child->hasAccess()) { continue; } $itemsubmenulinks[] = array('url' => self::getRouting()->generate('project_dashboard', array('project_key' => $child->getKey())), 'title' => $child->getName()); } } $hierarchy_breadcrumbs[] = array($t, $itemsubmenulinks); $projects_processed[$t->getKey()] = $t; $t = $parent; continue; } } } $clientsubmenulinks = null; if (self::$_selected_project->hasClient()) { $clientsubmenulinks = array(); foreach (TBGClient::getAll() as $client) { if ($client->hasAccess()) { $clientsubmenulinks[] = array('url' => self::getRouting()->generate('client_dashboard', array('client_id' => $client->getID())), 'title' => $client->getName()); } } self::setCurrentClient(self::$_selected_project->getClient()); } if (mb_strtolower(TBGSettings::getTBGname()) != mb_strtolower(self::$_selected_project->getName()) || self::isClientContext()) { self::getResponse()->addBreadcrumb(TBGSettings::getTBGName(), self::getRouting()->generate('home')); if (self::isClientContext()) { self::getResponse()->addBreadcrumb(self::getCurrentClient()->getName(), self::getRouting()->generate('client_dashboard', array('client_id' => self::getCurrentClient()->getID())), $clientsubmenulinks); } } // Add root breadcrumb first, so reverse order $hierarchy_breadcrumbs = array_reverse($hierarchy_breadcrumbs); foreach ($hierarchy_breadcrumbs as $breadcrumb) { $class = null; if ($breadcrumb[0]->getKey() == self::getCurrentProject()->getKey()) { $class = 'selected_project'; } self::getResponse()->addBreadcrumb($breadcrumb[0]->getName(), self::getRouting()->generate('project_dashboard', array('project_key' => $breadcrumb[0]->getKey())), $breadcrumb[1], $class); } } else { self::getResponse()->addBreadcrumb(TBGSettings::getTBGName(), self::getRouting()->generate('home')); } }
protected function _parse_insert_template($matches) { switch ($matches[1]) { case 'CURRENTMONTH': return date('m'); case 'CURRENTMONTHNAMEGEN': case 'CURRENTMONTHNAME': return date('F'); case 'CURRENTDAY': return date('d'); case 'CURRENTDAYNAME': return date('l'); case 'CURRENTYEAR': return date('Y'); case 'CURRENTTIME': return date('H:i'); case 'NUMBEROFARTICLES': return 0; case 'PAGENAME': return TBGContext::getResponse()->getPage(); case 'NAMESPACE': return 'None'; case 'TOC': return isset($this->options['included']) ? '' : '{{TOC}}'; case 'SITENAME': case 'SITETAGLINE': return TBGSettings::getTBGname(); default: $details = explode('|', $matches[1]); $template_name = array_shift($details); if (substr($template_name, 0, 1) == ':') { $template_name = substr($template_name, 1); } $template_name = TBGWikiArticle::doesArticleExist($template_name) ? $template_name : 'Template:' . $template_name; $template_article = TBGArticlesTable::getTable()->getArticleByName($template_name); $parameters = array(); if (count($details)) { foreach ($details as $parameter) { $param = explode('=', $parameter); if (count($param) == 2) { $parameters[$param[0]] = $param[1]; } else { $parameters[] = $parameter; } } } if ($template_article instanceof TBGWikiArticle) { return tbg_parse_text($template_article->getContent(), false, null, array('included' => true, 'parameters' => $parameters)); } else { return $matches[0]; } } }
protected function _setInitialMailValues(TBGMimemail $mail) { $from_name = $this->getEmailFromName(); $from_email = $this->getEmailFromAddress(); if (!$from_email) { throw new Exception('The email module does not have a "from" address'); } $mail->setFrom($this->getEmailFromAddress(), $this->getEmailFromName()); $pre_html_message = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv=Content-Type content="text/html; charset=' . $mail->getCharset() . '"><title>' . TBGSettings::getTBGname() . '</title></head><body>'; $post_html_message = '</body></html>'; $mail->decorateMessageHTML($pre_html_message, $post_html_message); $mail->addReplacementValues(array('%thebuggenie_url%' => TBGContext::getRouting()->generate('home', array(), false))); }