Exemplo n.º 1
0
 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;
         }
     }
 }
    }
    ?>
 text-align: center;">
                    <?php 
    include_component('configuration/permissionsinfoitem', array('key' => $key, 'target_id' => $target_id, 'type' => 'group', 'mode' => $mode, 'item_id' => $group->getID(), 'item_name' => $group->getName(), 'module' => $module, 'access_level' => $access_level));
    ?>
                </td>
            </tr>
            <?php 
    $cc++;
    ?>
        <?php 
}
?>
        <?php 
$teams = \thebuggenie\core\framework\Context::isProjectContext() ? \thebuggenie\core\framework\Context::getCurrentProject()->getAssignedTeams() : \thebuggenie\core\entities\Team::getAll();
?>
        <?php 
foreach ($teams as $team) {
    ?>
            <tr class="hover_highlight">
                <td style="padding: 2px;"><?php 
    echo '<b>' . __('Team: %team_name', array('%team_name' => '</b>' . $team->getName()));
    ?>
</td>
                <td style="padding: 2px; text-align: center;">
                    <?php 
    include_component('configuration/permissionsinfoitem', array('key' => $key, 'type' => 'team', 'target_id' => $target_id, 'mode' => $mode, 'item_id' => $team->getID(), 'item_name' => $team->getName(), 'module' => $module, 'access_level' => $access_level));
    ?>
                </td>
            </tr>
<?php

$article_name = isset($article_name) ? $article_name : '';
if (!\thebuggenie\core\framework\Context::isProjectContext() || \thebuggenie\core\framework\Context::isProjectContext() && mb_strtolower($article_name) != mb_strtolower(\thebuggenie\core\framework\Context::getCurrentProject()->getKey() . ':mainpage')) {
    if (\thebuggenie\core\framework\Context::isProjectContext()) {
        $tbg_response->addBreadcrumb(\thebuggenie\core\framework\Context::getModule('publish')->getMenuTitle(), make_url('publish_article', array('article_name' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey() . ':MainPage')));
    } else {
        $tbg_response->addBreadcrumb(\thebuggenie\core\framework\Context::getModule('publish')->getMenuTitle(), make_url('publish_article', array('article_name' => 'MainPage')));
    }
    $items = explode(':', $article_name);
    $bcpath = array_shift($items);
    if (mb_strtolower($bcpath) == 'category') {
        $tbg_response->addBreadcrumb(__('Categories'));
        if (\thebuggenie\core\framework\Context::isProjectContext()) {
            $bcpath .= ":" . array_shift($items);
        }
    } elseif (!\thebuggenie\core\framework\Context::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(\thebuggenie\core\framework\Context::getModule('publish')->getMenuTitle(), make_url('publish_article', array('article_name' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey() . ':MainPage')));
}
        }
        ?>
                        <?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 
framework\Event::createNew('core', 'templates/headermainmenu::projectmenulinks', framework\Context::getCurrentProject())->trigger();
?>
    </ul>
    <?php 
if (framework\Context::isProjectContext() && !framework\Context::getCurrentProject()->isArchived() && !framework\Context::getCurrentProject()->isLocked() && ($tbg_user->canReportIssues() || $tbg_user->canReportIssues(framework\Context::getCurrentProject()->getID()))) {
    ?>
        <div class="reportissue_button_container">
        <?php 
    echo javascript_link_tag(image_tag('icon-mono-add.png') . __('Report an issue'), array('onclick' => "TBG.Issues.Add('" . make_url('get_partial_for_backdrop', array('key' => 'reportissue', 'project_id' => framework\Context::getCurrentProject()->getId())) . "');", 'class' => 'button button-lightblue', 'id' => 'reportissue_button'));
    ?>
        </div>
    <?php 
}
framework\Event::createNew('core', 'before_header_userinfo')->trigger();
?>
</nav>
Exemplo n.º 5
0
 public function listen_sidebar_links(framework\Event $event)
 {
     if (framework\Context::isProjectContext()) {
         include_component('vcs_integration/menustriplinks', array('project' => framework\Context::getCurrentProject(), 'module' => $this, 'submenu' => $event->getParameter('submenu')));
     }
 }
Exemplo n.º 6
0
 /**
  * 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');
     }
 }
Exemplo n.º 7
0
 /**
  * Header "Agile" menu and board list
  *
  * @Listener(module="core", identifier="templates/headermainmenu::projectmenulinks")
  *
  * @param \thebuggenie\core\framework\Event $event
  */
 public function headerMenuProjectLinks(framework\Event $event)
 {
     if (framework\Context::isProjectContext()) {
         $boards = \thebuggenie\modules\agile\entities\AgileBoard::getB2DBTable()->getAvailableProjectBoards(framework\Context::getUser()->getID(), framework\Context::getCurrentProject()->getID());
         framework\ActionComponent::includeComponent('agile/headermenuprojectlinks', array('project' => $event->getSubject(), 'boards' => $boards));
     }
 }
Exemplo n.º 8
0
                                <input type="checkbox" name="update_issue[<?php 
            echo $issue->getID();
            ?>
]" value="<?php 
            echo $issue->getID();
            ?>
">
                            <?php 
        }
        ?>
                        </td>
                    <?php 
    }
    ?>
                <?php 
    if (!\thebuggenie\core\framework\Context::isProjectContext() && $show_project == true) {
        ?>
                    <td style="padding-left: 5px;"><?php 
        echo link_tag(make_url('project_issues', array('project_key' => $issue->getProject()->getKey())), $issue->getProject()->getName());
        ?>
</td>
                <?php 
    }
    ?>
                    <td class="sc_issuetype"<?php 
    if (!in_array('issuetype', $visible_columns)) {
        ?>
 style="display: none;"<?php 
    }
    ?>
>
Exemplo n.º 9
0
 public function componentExtralinks()
 {
     switch (true) {
         case framework\Context::getRequest()->hasParameter('quicksearch'):
             $searchfor = framework\Context::getRequest()->getParameter('searchfor');
             $project_key = framework\Context::getCurrentProject() instanceof entities\Project ? framework\Context::getCurrentProject()->getKey() : 0;
             $this->csv_url = framework\Context::getRouting()->generate('project_issues', array('project_key' => $project_key, 'quicksearch' => 'true', 'format' => 'csv')) . '?searchfor=' . $searchfor;
             $this->rss_url = framework\Context::getRouting()->generate('project_issues', array('project_key' => $project_key, 'quicksearch' => 'true', 'format' => 'rss')) . '?searchfor=' . $searchfor;
             break;
         case framework\Context::getRequest()->hasParameter('predefined_search'):
             $searchno = framework\Context::getRequest()->getParameter('predefined_search');
             $project_key = framework\Context::getCurrentProject() instanceof entities\Project ? framework\Context::getCurrentProject()->getKey() : 0;
             $url = framework\Context::getCurrentProject() instanceof entities\Project ? 'project_issues' : 'search';
             $this->csv_url = framework\Context::getRouting()->generate($url, array('project_key' => $project_key, 'predefined_search' => $searchno, 'search' => '1', 'format' => 'csv'));
             $this->rss_url = framework\Context::getRouting()->generate($url, array('project_key' => $project_key, 'predefined_search' => $searchno, 'search' => '1', 'format' => 'rss'));
             break;
         default:
             preg_match('/((?<=\\/)issues).+$/i', framework\Context::getRequest()->getQueryString(), $get);
             if (!isset($get[0])) {
                 preg_match('/((?<=url=)issues).+$/i', framework\Context::getRequest()->getQueryString(), $get);
             }
             if (isset($get[0])) {
                 if (framework\Context::isProjectContext()) {
                     $this->csv_url = framework\Context::getRouting()->generate('project_issues', array('project_key' => framework\Context::getCurrentProject()->getKey(), 'format' => 'csv')) . '/' . $get[0];
                     $this->rss_url = framework\Context::getRouting()->generate('project_issues', array('project_key' => framework\Context::getCurrentProject()->getKey(), 'format' => 'rss')) . '?' . $get[0];
                 } else {
                     $this->csv_url = framework\Context::getRouting()->generate('search', array('format' => 'csv')) . '/' . $get[0];
                     $this->rss_url = framework\Context::getRouting()->generate('search', array('format' => 'rss')) . '?' . $get[0];
                 }
             }
             break;
     }
     $i18n = framework\Context::getI18n();
     $this->columns = array('title' => $i18n->__('Issue title'), 'issuetype' => $i18n->__('Issue type'), 'assigned_to' => $i18n->__('Assigned to'), 'status' => $i18n->__('Status'), 'resolution' => $i18n->__('Resolution'), 'category' => $i18n->__('Category'), 'severity' => $i18n->__('Severity'), 'percent_complete' => $i18n->__('% completed'), 'reproducability' => $i18n->__('Reproducability'), 'priority' => $i18n->__('Priority'), 'components' => $i18n->__('Component(s)'), 'milestone' => $i18n->__('Milestone'), 'estimated_time' => $i18n->__('Estimate'), 'spent_time' => $i18n->__('Time spent'), 'last_updated' => $i18n->__('Last updated time'), 'comments' => $i18n->__('Number of comments'));
 }
Exemplo n.º 10
0
 public function extractIssues($matches)
 {
     $issue = entities\Issue::getIssueFromLink($matches["issues"]);
     if ($issue instanceof entities\Issue) {
         if (!framework\Context::isProjectContext() || framework\Context::isProjectContext() && $issue->getProjectID() == framework\Context::getCurrentProject()->getID()) {
             $this->foundissues[$issue->getID()] = $issue;
             $this->resultcount++;
         }
     }
 }
Exemplo n.º 11
0
                                </div>
                            </div>
                        </div>
                        <?php 
        if ($a_savedsearch->getDescription() != '') {
            ?>
                            <div style="clear: both; padding: 0 0 10px 3px;"><?php 
            echo $a_savedsearch->getDescription();
            ?>
</div>
                        <?php 
        }
        ?>
                    </li>
                <?php 
    }
    ?>
            <?php 
} else {
    ?>
                <li class="no_items" style="font-size: 1em;" id="no_public_saved_searches"><?php 
    echo \thebuggenie\core\framework\Context::isProjectContext() ? __("There are no saved searches for this project") : __("There are no public saved searches");
    ?>
</li>
            <?php 
}
?>
        </ul>
    </div>
</td>
Exemplo n.º 12
0
][<?php 
        echo $key;
        ?>
][value]" id="filter_<?php 
        echo $filter;
        ?>
_<?php 
        echo $key;
        ?>
">
                <option value="0"> - </option>
                <?php 
        foreach ($filters[$filter]['options'] as $item) {
            ?>
                    <?php 
            if (method_exists($item, 'getProject') && (\thebuggenie\core\framework\Context::isProjectContext() && $item->getProject()->getID() != \thebuggenie\core\framework\Context::getCurrentProject()->getID() || !\thebuggenie\core\framework\Context::isProjectContext())) {
                ?>
                        <option value="<?php 
                echo $item->getID();
                ?>
"<?php 
                if ($selected_value == $item->getID()) {
                    ?>
 selected<?php 
                }
                ?>
><?php 
                echo $item->getProject()->getName() . '&nbsp;&ndash;&nbsp;' . $item->getName();
                ?>
</option>
                    <?php 
Exemplo n.º 13
0
<?php

$children = $main_article->getChildArticles();
$is_parent = in_array($main_article->getID(), $parents);
$is_selected = $main_article->getID() == $article->getID() || $main_article->isRedirect() && $main_article->getRedirectArticleName() == $article->getTitle();
$is_first = $first;
$first = false;
$project_key = \thebuggenie\core\framework\Context::isProjectContext() ? \thebuggenie\core\framework\Context::getCurrentProject()->getKey() . ':' : '';
//    $article_name = (strpos(mb_strtolower($main_article->getTitle()), 'category:') !== false) ? substr($main_article->getTitle(), 9+mb_strlen($project_key)) : substr($main_article->getTitle(), mb_strlen($project_key));
?>
<li class="<?php 
echo isset($level) && $level >= 1 ? 'child' : 'parent';
?>
 <?php 
if ($is_parent && !$is_selected) {
    echo 'parent';
}
?>
 <?php 
if ($is_selected) {
    echo 'selected';
}
?>
 level_<?php 
echo $level;
?>
" id="article_sidebar_link_<?php 
echo $article->getID();
?>
">
    <?php 
Exemplo n.º 14
0
 public function componentLeftmenu()
 {
     $this->show_article_options = (bool) ($this->article instanceof Article);
     $this->links_target_id = framework\Context::isProjectContext() ? framework\Context::getCurrentProject()->getID() : 0;
     $this->links = framework\Context::getModule('publish')->getMenuItems($this->links_target_id);
 }
Exemplo n.º 15
0
    <ShortName><?php 
echo \thebuggenie\core\framework\Context::isProjectContext() ? __('%project_name search', array('%project_name' => \thebuggenie\core\framework\Context::getCurrentProject()->getName())) : __('%site_name search', array('%site_name' => \thebuggenie\core\framework\Settings::getSiteHeaderName()));
?>
</ShortName>
    <LongName><?php 
echo \thebuggenie\core\framework\Context::isProjectContext() ? __('%project_name search', array('%project_name' => \thebuggenie\core\framework\Context::getCurrentProject()->getName())) : __('%site_name search', array('%site_name' => \thebuggenie\core\framework\Settings::getSiteHeaderName()));
?>
</LongName>
    <Description><?php 
echo \thebuggenie\core\framework\Context::isProjectContext() ? __('%project_name search', array('%project_name' => \thebuggenie\core\framework\Context::getCurrentProject()->getName())) : __('%site_name search', array('%site_name' => \thebuggenie\core\framework\Settings::getSiteHeaderName()));
?>
</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 \thebuggenie\core\framework\Context::isProjectContext() ? make_url('project_issues', array('project_key' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey()), false) : make_url('search', array(), false);
?>
?fs[text][o]=%3A&amp;fs[text][v]={searchTerms}"/>
    <Url type="application/x-suggestions+json" template="<?php 
echo \thebuggenie\core\framework\Context::isProjectContext() ? make_url('project_quicksearch', array('project_key' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey(), 'format' => 'json'), false) : make_url('quicksearch', array('format' => 'json'), false);
?>
?fs[text][o]=%3A&amp;fs[text][v]={searchTerms}"/>
    <AdultContent>false</AdultContent>
    <OutputEncoding><?php 
echo \thebuggenie\core\framework\Context::getI18n()->getCharset();
?>
</OutputEncoding>
    <Contact>support@thebuggenie.com</Contact>
    <Query role="example" searchTerms="opensearch"/>
    <Attribution>No copyright</Attribution>
    <SyndicationRight>open</SyndicationRight>
</OpenSearchDescription>
Exemplo n.º 16
0
 /**
  *
  * @param \b2db\Criteria $crit
  * @param array|\thebuggenie\core\entities\SearchFilter $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']}%";
                 $issue_no = Issue::extractIssueNoFromNumber($this['value']);
                 if ($this['operator'] == '=') {
                     if ($ctn === null) {
                         $ctn = $crit->returnCriterion(tables\Issues::TITLE, $searchterm, Criteria::DB_LIKE);
                     }
                     $ctn->addOr(tables\Issues::DESCRIPTION, $searchterm, Criteria::DB_LIKE);
                     $ctn->addOr(tables\Issues::REPRODUCTION_STEPS, $searchterm, Criteria::DB_LIKE);
                     $ctn->addOr(tables\IssueCustomFields::OPTION_VALUE, $searchterm, Criteria::DB_LIKE);
                     if (is_numeric($issue_no)) {
                         $ctn->addOr(tables\Issues::ISSUE_NO, $issue_no, Criteria::DB_EQUALS);
                     }
                     $ctn->addOr(tables\IssueCustomFields::OPTION_VALUE, $searchterm, Criteria::DB_LIKE);
                     if (is_numeric($issue_no)) {
                         $ctn->addOr(tables\Issues::ISSUE_NO, $issue_no, Criteria::DB_EQUALS);
                     }
                     // $ctn->addOr(tables\IssueCustomFields::OPTION_VALUE, $searchterm, Criteria::DB_LIKE);
                 } else {
                     if ($ctn === null) {
                         $ctn = $crit->returnCriterion(tables\Issues::TITLE, $searchterm, Criteria::DB_NOT_LIKE);
                     }
                     $ctn->addWhere(tables\Issues::DESCRIPTION, $searchterm, Criteria::DB_NOT_LIKE);
                     $ctn->addWhere(tables\Issues::REPRODUCTION_STEPS, $searchterm, Criteria::DB_NOT_LIKE);
                     $ctn->addOr(tables\IssueCustomFields::OPTION_VALUE, $searchterm, Criteria::DB_NOT_LIKE);
                     if (is_numeric($issue_no)) {
                         $ctn->addWhere(tables\Issues::ISSUE_NO, $issue_no, Criteria::DB_EQUALS);
                     }
                     $ctn->addOr(tables\IssueCustomFields::OPTION_VALUE, $searchterm, Criteria::DB_NOT_LIKE);
                     if (is_numeric($issue_no)) {
                         $ctn->addWhere(tables\Issues::ISSUE_NO, $issue_no, Criteria::DB_EQUALS);
                     }
                     // $ctn->addOr(tables\IssueCustomFields::OPTION_VALUE, $searchterm, Criteria::DB_NOT_LIKE);
                 }
                 return $ctn;
             }
         } elseif (in_array($filter_key, self::getValidSearchFilters())) {
             if ($filter_key == 'subprojects') {
                 if (framework\Context::isProjectContext()) {
                     if ($ctn === null) {
                         $ctn = $crit->returnCriterion(tables\Issues::PROJECT_ID, framework\Context::getCurrentProject()->getID());
                     }
                     if ($this->hasValue()) {
                         foreach ($this->getValues() as $value) {
                             switch ($value) {
                                 case 'all':
                                     $subprojects = Project::getIncludingAllSubprojectsAsArray(framework\Context::getCurrentProject());
                                     foreach ($subprojects as $subproject) {
                                         if ($subproject->getID() == framework\Context::getCurrentProject()->getID()) {
                                             continue;
                                         }
                                         $ctn->addOr(tables\Issues::PROJECT_ID, $subproject->getID());
                                     }
                                     break;
                                 case 'none':
                                 case '':
                                     break;
                                 default:
                                     $ctn->addOr(tables\Issues::PROJECT_ID, (int) $value);
                                     break;
                             }
                         }
                     }
                     return $ctn;
                 }
             } elseif (in_array($filter_key, array('build', 'edition', 'component'))) {
                 switch ($filter_key) {
                     case 'component':
                         $tbl = tables\IssueAffectsComponent::getTable();
                         $fk = tables\IssueAffectsComponent::ISSUE;
                         break;
                     case 'edition':
                         $tbl = tables\IssueAffectsEdition::getTable();
                         $fk = tables\IssueAffectsEdition::ISSUE;
                         break;
                     case 'build':
                         $tbl = tables\IssueAffectsBuild::getTable();
                         $fk = tables\IssueAffectsBuild::ISSUE;
                         break;
                 }
                 $crit->addJoin($tbl, $fk, tables\Issues::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(tables\Issues::STATE, Issue::STATE_OPEN);
                         $num_values++;
                     }
                     if ($this->hasValue('closed')) {
                         $num_values++;
                         if (isset($c)) {
                             $c->addWhere(tables\Issues::STATE, Issue::STATE_CLOSED);
                         } else {
                             $c = $crit->returnCriterion(tables\Issues::STATE, Issue::STATE_CLOSED);
                         }
                     }
                     if (isset($c)) {
                         if (count($values) == $num_values) {
                             return $c;
                         } else {
                             $crit->addWhere($c);
                         }
                     }
                 }
                 $dbname = tables\Issues::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 (CustomDatatype::doesKeyExist($filter_key)) {
             $customdatatype = CustomDatatype::getByKey($filter_key);
             if (in_array($this->getFilterType(), CustomDatatype::getInternalChoiceFieldsAsArray())) {
                 $tbl = clone tables\IssueCustomFields::getTable();
                 $crit->addJoin($tbl, tables\IssueCustomFields::ISSUE_ID, tables\Issues::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(tables\IssueCustomFields::CUSTOMFIELDS_ID, $customdatatype->getID());
                             $ctn->addWhere(tables\IssueCustomFields::CUSTOMFIELDOPTION_ID, $value, $this['operator']);
                         } else {
                             $ctn->addOr(tables\IssueCustomFields::CUSTOMFIELDOPTION_ID, $value, $this['operator']);
                         }
                     } else {
                         if ($ctn === null) {
                             $ctn = $crit->returnCriterion(tables\IssueCustomFields::CUSTOMFIELDS_ID, $customdatatype->getID());
                             $ctn->addWhere(tables\IssueCustomFields::OPTION_VALUE, $value, $this['operator']);
                         } else {
                             $ctn->addOr(tables\IssueCustomFields::OPTION_VALUE, $value, $this['operator']);
                         }
                     }
                 }
                 return $ctn;
             }
         }
     }
 }
Exemplo n.º 17
0
<?php

if ($role instanceof \thebuggenie\core\entities\Role) {
    ?>
    <li class="greybox" style="padding: 3px 5px; margin-bottom: 5px;" id="role_<?php 
    echo $role->getID();
    ?>
_container">
        <div class="button-group" style="float: right; margin-right: -3px; margin-top: -1px;">
            <?php 
    echo javascript_link_tag(__('Details'), array('onclick' => "TBG.Config.Roles.getPermissions('" . make_url('configure_role', array('role_id' => $role->getID(), 'mode' => 'list_permissions')) . "', 'role_{$role->getID()}_permissions_list');", 'class' => 'button button-silver'));
    ?>
            <?php 
    if (!\thebuggenie\core\framework\Context::isProjectContext() || !$role->isSystemRole()) {
        ?>
                <?php 
        echo javascript_link_tag(__('Edit'), array('onclick' => "TBG.Config.Roles.getPermissionsEdit('" . make_url('configure_role', array('role_id' => $role->getID(), 'mode' => 'edit')) . "', 'role_{$role->getID()}_permissions_edit');", 'class' => 'button button-silver'));
        ?>
                <button class="button button-silver" onclick="TBG.Main.Helpers.Dialog.show('<?php 
        echo __('Delete this role?');
        ?>
', '<?php 
        echo __('Do you really want to delete this role?') . '<br>' . __('Users assigned via this role will be unassigned, and depending on other roles their project permissions may be reset.') . '<br><b>' . __('This action cannot be reverted') . '</b>';
        ?>
', {yes: {click: function() {TBG.Config.Roles.remove('<?php 
        echo make_url('configure_role', array('role_id' => $role->getID(), 'mode' => 'delete'));
        ?>
', <?php 
        print $role->getID();
        ?>
);}}, no: {click: TBG.Main.Helpers.Dialog.dismiss}});"><?php 
Exemplo n.º 18
0
                                <?php 
    echo __('Comments (%count)', array('%count' => '<span id="viewissue_comment_count"></span>'));
    ?>
                                <div class="dropper_container">
                                    <?php 
    echo image_tag('icon-mono-settings.png', array('class' => 'dropper'));
    ?>
                                    <ul class="more_actions_dropdown dropdown_box popup_box leftie">
                                        <li><a href="javascript:void(0);" id="comments_show_system_comments_toggle" onclick="$$('#comments_box .system_comment').each(function (elm) { $(elm).toggle(); });" /><?php 
    echo __('Toggle system-generated comments');
    ?>
</a></li>
                                    </ul>
                                </div>
                                <?php 
    if ($tbg_user->canPostComments() && (\thebuggenie\core\framework\Context::isProjectContext() && !\thebuggenie\core\framework\Context::getCurrentProject()->isArchived() || !\thebuggenie\core\framework\Context::isProjectContext())) {
        ?>
                                    <ul class="simple_list button_container" id="add_comment_button_container">
                                        <li id="comment_add_button"><input class="button button-silver first last" type="button" onclick="TBG.Main.Comment.showPost();" value="<?php 
        echo __('Post comment');
        ?>
"></li>
                                    </ul>
                                <?php 
    }
    ?>
                            </legend>
                            <div id="viewissue_comments">
                                <?php 
    include_component('main/comments', array('target_id' => $issue->getID(), 'mentionable_target_type' => 'issue', 'target_type' => \thebuggenie\core\entities\Comment::TYPE_ISSUE, 'show_button' => false, 'comment_count_div' => 'viewissue_comment_count', 'save_changes_checked' => $issue->hasUnsavedChanges(), 'issue' => $issue, 'forward_url' => make_url('viewissue', array('project_key' => $issue->getProject()->getKey(), 'issue_no' => $issue->getFormattedIssueNo()), false)));
    ?>
Exemplo n.º 19
0
 public static function findIssues($filters = array(), $results_per_page = 30, $offset = 0, $groupby = null, $grouporder = null, $sortfields = array(tables\Issues::LAST_UPDATED => 'asc'))
 {
     $issues = array();
     list($rows, $count, $ids) = tables\Issues::getTable()->findIssues($filters, $results_per_page, $offset, $groupby, $grouporder, $sortfields);
     if ($rows) {
         if (framework\Context::isProjectContext()) {
             framework\Context::getCurrentProject()->preloadValues();
         }
         tables\IssueCustomFields::getTable()->preloadValuesByIssueIDs($ids);
         tables\IssueAffectsBuild::getTable()->preloadValuesByIssueIDs($ids);
         tables\IssueAffectsEdition::getTable()->preloadValuesByIssueIDs($ids);
         tables\IssueAffectsComponent::getTable()->preloadValuesByIssueIDs($ids);
         tables\Comments::getTable()->preloadIssueCommentCounts($ids);
         tables\IssueFiles::getTable()->preloadIssueFileCounts($ids);
         $user_ids = array();
         foreach ($rows as $key => $row) {
             try {
                 $issue = new Issue($row->get(tables\Issues::ID), $row);
                 $user_ids[$row['issues.posted_by']] = true;
                 $issues[] = $issue;
                 unset($rows[$key]);
             } catch (\Exception $e) {
             }
         }
         if (count($user_ids)) {
             tables\Users::getTable()->preloadUsers(array_keys($user_ids));
         }
         foreach ($issues as $key => $issue) {
             if (!$issue->hasAccess() || $issue->getProject()->isDeleted()) {
                 unset($issues[$key]);
             }
         }
         tables\IssueCustomFields::getTable()->clearPreloadedValues();
         tables\IssueAffectsBuild::getTable()->clearPreloadedValues();
         tables\IssueAffectsEdition::getTable()->clearPreloadedValues();
         tables\IssueAffectsComponent::getTable()->clearPreloadedValues();
         tables\Comments::getTable()->clearPreloadedIssueCommentCounts();
         tables\IssueFiles::getTable()->clearPreloadedIssueFileCounts();
     }
     return array($issues, $count);
 }
Exemplo n.º 20
0
    ?>
                <div class="greenbox" style="margin: 0 0 5px 5px; font-size: 14px;">
                    <b><?php 
    echo $message;
    ?>
</b>
                </div>
            <?php 
}
?>
            <h2><?php 
echo __('Find articles');
?>
</h2>
            <form action="<?php 
echo \thebuggenie\core\framework\Context::isProjectContext() ? make_url('publish_find_project_articles', array('project_key' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey())) : make_url('publish_find_articles');
?>
" method="get" accept-charset="<?php 
echo \thebuggenie\core\framework\Context::getI18n()->getCharset();
?>
">
                <label for="find_article_name" style="font-size: 1.1em; float: left;"><?php 
echo __('Find articles by name');
?>
</label><input type="text" name="articlename" id="find_article_name" value="<?php 
echo \thebuggenie\core\framework\Context::getI18n()->__e($articlename);
?>
" style="width: 400px; float: left; margin-left: 5px; padding: 2px; font-size: 1.3em;">
                <input type="submit" value="<?php 
echo __('Find');
?>
Exemplo n.º 21
0
 public function componentSearchbuilder()
 {
     $this->templates = entities\SavedSearch::getTemplates();
     $this->filters = $this->appliedfilters;
     $this->nondatecustomfields = entities\CustomDatatype::getAllExceptTypes(array(entities\CustomDatatype::DATE_PICKER));
     $this->datecustomfields = entities\CustomDatatype::getByFieldType(entities\CustomDatatype::DATE_PICKER);
     $i18n = framework\Context::getI18n();
     $columns = array('title' => $i18n->__('Issue title'), 'issuetype' => $i18n->__('Issue type'), 'assigned_to' => $i18n->__('Assigned to'), 'posted_by' => $i18n->__('Posted by'), 'status' => $i18n->__('Status'), 'resolution' => $i18n->__('Resolution'), 'category' => $i18n->__('Category'), 'severity' => $i18n->__('Severity'), 'percent_complete' => $i18n->__('Percent completed'), 'reproducability' => $i18n->__('Reproducability'), 'priority' => $i18n->__('Priority'), 'components' => $i18n->__('Component(s)'), 'milestone' => $i18n->__('Milestone'), 'estimated_time' => $i18n->__('Estimate'), 'spent_time' => $i18n->__('Time spent'), 'last_updated' => $i18n->__('Last updated time'), 'posted' => $i18n->__('Posted at'), 'comments' => $i18n->__('Number of comments'));
     foreach ($this->nondatecustomfields as $field) {
         $columns[$field->getKey()] = $i18n->__($field->getName());
     }
     foreach ($this->datecustomfields as $field) {
         $columns[$field->getKey()] = $i18n->__($field->getName());
     }
     $this->columns = $columns;
     $groupoptions = array();
     if (!framework\Context::isProjectContext()) {
         $groupoptions['project_id'] = $i18n->__('Project');
     }
     $groupoptions['milestone'] = $i18n->__('Milestone');
     $groupoptions['assignee'] = $i18n->__("Who's assigned");
     $groupoptions['posted_by'] = $i18n->__("Who posted the issue");
     $groupoptions['state'] = $i18n->__('State (open or closed)');
     $groupoptions['status'] = $i18n->__('Status');
     $groupoptions['category'] = $i18n->__('Category');
     $groupoptions['priority'] = $i18n->__('Priority');
     $groupoptions['severity'] = $i18n->__('Severity');
     $groupoptions['resolution'] = $i18n->__('Resolution');
     $groupoptions['issuetype'] = $i18n->__('Issue type');
     $groupoptions['edition'] = $i18n->__('Edition');
     $groupoptions['build'] = $i18n->__('Release');
     $groupoptions['component'] = $i18n->__('Component');
     $groupoptions['posted'] = $i18n->__('Posted at');
     $this->groupoptions = $groupoptions;
 }
Exemplo n.º 22
0
            <?php 
        }
        ?>
        <?php 
    }
    ?>
        <?php 
    if (!$search_object->hasQuickfoundIssues() && $search_object->getTotalNumberOfIssues() > $search_object->getNumberOfIssues()) {
        ?>
            <li class="find_more_issues last">
                <span class="informal"><?php 
        echo __('See %num more issues ...', array('%num' => $search_object->getTotalNumberOfIssues() - $search_object->getNumberOfIssues()));
        ?>
</span>
                <div class="hidden url"><?php 
        echo \thebuggenie\core\framework\Context::isProjectContext() ? make_url('project_issues', array('project_key' => \thebuggenie\core\framework\Context::getCurrentProject()->getKey())) : make_url('search');
        ?>
?fs[text][v]=<?php 
        echo $searchterm;
        ?>
&fs[text][o]=<?php 
        echo urlencode('=');
        ?>
</div>
            </li>
        <?php 
    }
    ?>
    <?php 
} else {
    ?>
Exemplo n.º 23
0
 public function getTabKey()
 {
     return framework\Context::isProjectContext() ? parent::getTabKey() : 'wiki';
 }
Exemplo n.º 24
0
">

        </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; */
Exemplo n.º 25
0
 /**
  * Returns an array of teams which the current user is a member of
  *
  * @return array|Team
  */
 public function getTeams()
 {
     $this->_populateTeams();
     $teams = $this->_teams['assigned'];
     if (framework\Context::isProjectContext()) {
         $project = framework\Context::getCurrentProject();
     } else {
         if (framework\Context::getRequest()->hasParameter('issue_id')) {
             $issue = Issue::getB2DBTable()->selectById(framework\Context::getRequest()->getParameter('issue_id'));
             if ($issue instanceof Issue && $issue->getProject() instanceof Project) {
                 $project = $issue->getProject();
             }
         }
     }
     if (isset($project)) {
         $project_assigned_teams = $project->getAssignedTeams();
         foreach ($teams as $team_id => $team) {
             if (!array_key_exists($team_id, $project_assigned_teams)) {
                 unset($teams[$team_id]);
             }
         }
     }
     return $teams;
 }
Exemplo n.º 26
0
<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>
Exemplo n.º 27
0
 protected function _populateOptions()
 {
     if ($this->_options === null) {
         if ($this->hasCustomOptions()) {
             $this->_b2dbLazyload('_options');
         } else {
             switch ($this->getType()) {
                 case self::RELEASES_CHOICE:
                     $this->_options = framework\Context::isProjectContext() ? framework\Context::getCurrentProject()->getBuilds() : \thebuggenie\core\entities\tables\Builds::getTable()->selectAll();
                     break;
                 case self::COMPONENTS_CHOICE:
                     $this->_options = framework\Context::isProjectContext() ? framework\Context::getCurrentProject()->getComponents() : \thebuggenie\core\entities\tables\Components::getTable()->selectAll();
                     break;
                 case self::EDITIONS_CHOICE:
                     $this->_options = framework\Context::isProjectContext() ? framework\Context::getCurrentProject()->getEditions() : \thebuggenie\core\entities\tables\Editions::getTable()->selectAll();
                     break;
                 case self::MILESTONE_CHOICE:
                     $this->_options = framework\Context::isProjectContext() ? framework\Context::getCurrentProject()->getMilestonesForIssues() : \thebuggenie\core\entities\tables\Milestones::getTable()->selectAll();
                     break;
                 case self::STATUS_CHOICE:
                     $this->_options = \thebuggenie\core\entities\Status::getAll();
                     break;
             }
         }
     }
 }
Exemplo n.º 28
0
            <div style="font-weight: normal; margin: 0 0 15px 5px;">
                <form action="<?php 
    echo make_url('publish_find_articles');
    ?>
" method="get" accept-charset="<?php 
    echo \thebuggenie\core\framework\Context::getI18n()->getCharset();
    ?>
">
                    <input type="search" name="articlename" placeholder="<?php 
    echo $quicksearch_title;
    ?>
">
                </form>
            </div>
            <?php 
    if (count(\thebuggenie\core\entities\Project::getAll()) > (int) \thebuggenie\core\framework\Context::isProjectContext()) {
        ?>
                <div class="header"><?php 
        echo __('Project wikis');
        ?>
</div>
                <?php 
        foreach (\thebuggenie\core\entities\Project::getAll() as $project) {
            ?>
                    <?php 
            if (!$project->hasAccess() || isset($project_url) && $project->getID() == \thebuggenie\core\framework\Context::getCurrentProject()->getID()) {
                continue;
            }
            ?>
                    <?php 
            if (!$project->hasWikiURL()) {
Exemplo n.º 29
0
    ?>
</li>
                <li><?php 
    echo javascript_link_tag(__('Add menu item'), array('onclick' => "TBG.Main.Profile.clearPopupsAndButtons();\$('attach_link_{$target_type}_{$target_id}').toggle();"));
    ?>
</li>
            </ul>
        <?php 
}
?>
        <?php 
echo $title;
?>
    </div>
    <?php 
if ($tbg_user->canEditMainMenu($target_type) && (\thebuggenie\core\framework\Context::isProjectContext() && !\thebuggenie\core\framework\Context::getCurrentProject()->isArchived() || !\thebuggenie\core\framework\Context::isProjectContext())) {
    ?>
        <div class="rounded_box white shadowed" id="attach_link_<?php 
    echo $target_type;
    ?>
_<?php 
    echo $target_id;
    ?>
" style="position: absolute; width: 300px; z-index: 10001; margin: -1px 0 5px 5px; display: none; top: 0; left: 305px;">
            <div class="header_div" style="margin: 0 0 5px 0;"><?php 
    echo __('Add a link');
    ?>
:</div>
            <form action="<?php 
    echo make_url('attach_link', array('target_type' => $target_type, 'target_id' => $target_id));
    ?>