コード例 #1
0
 public function runConfigureUsers(TBGRequest $request)
 {
     $this->groups = TBGGroup::getAll();
     $this->teams = TBGTeam::getAll();
     $this->clients = TBGClient::getall();
     $this->finduser = $request->getParameter('finduser');
 }
コード例 #2
0
 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;
 }
コード例 #3
0
        ?>
 class="selected"<?php 
    }
    ?>
>
												<div>
													<?php 
    echo link_tag('javascript:void(0)', image_tag('tab_teams.png') . __('Teams'), array('class' => 'not_clickable'));
    ?>
													<?php 
    echo javascript_link_tag(image_tag('tabmenu_dropdown.png', array('class' => 'menu_dropdown')), array('onmouseover' => ""));
    ?>
												</div>
												<div id="team_menu" class="tab_menu_dropdown shadowed">
													<?php 
    foreach (TBGTeam::getAll() as $team) {
        ?>
														<?php 
        if (!$team->hasAccess()) {
            continue;
        }
        ?>
														<?php 
        echo link_tag(make_url('team_dashboard', array('team_id' => $team->getID())), image_tag('tab_teams.png') . $team->getName());
        ?>
													<?php 
    }
    ?>
												</div>											
											</li>
										<?php 
コード例 #4
0
									<label for="team_<?php 
        echo $user->getID();
        ?>
_<?php 
        echo $team->getID();
        ?>
" style="font-weight: normal;"><?php 
        echo $team->getName();
        ?>
</label>&nbsp;&nbsp;
								</div>
							<?php 
    }
    ?>
							<?php 
    if (count(TBGTeam::getAll()) == 0) {
        ?>
								<?php 
        echo __('No teams exist');
        ?>
							<?php 
    }
    ?>
						</td>
					</tr>
					<tr>
						<td style="vertical-align: top; padding-top: 4px;"><label><?php 
    echo __('Member of client(s)');
    ?>
</label></td>
						<td colspan="3">
コード例 #5
0
    }
    ?>
 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 = TBGTeam::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>
コード例 #6
0
 public function isValid($input)
 {
     switch ($this->_name) {
         case self::RULE_MAX_ASSIGNED_ISSUES:
             $num_issues = (int) $this->getRuleValue();
             return $num_issues ? (bool) (count(TBGContext::getUser()->getUserAssignedIssues()) < $num_issues) : true;
             break;
         case self::RULE_TEAM_MEMBERSHIP_VALID:
             $valid_items = explode(',', $this->getRuleValue());
             $teams = TBGTeam::getAll();
             if ($this->isPost()) {
                 if ($input instanceof TBGIssue) {
                     $assignee = $input->getAssignee();
                 }
             } else {
                 $assignee = TBGContext::getUser();
             }
             if ($assignee instanceof TBGUser) {
                 foreach ($valid_items as $team_id) {
                     if ($assignee->isMemberOfTeam($teams[$team_id])) {
                         return true;
                     }
                 }
             } elseif ($assignee instanceof TBGTeam) {
                 foreach ($valid_items as $team_id) {
                     if ($assignee->getID() == $team_id) {
                         return true;
                     }
                 }
             }
             return false;
         case self::RULE_STATUS_VALID:
         case self::RULE_PRIORITY_VALID:
         case self::RULE_RESOLUTION_VALID:
         case self::RULE_REPRODUCABILITY_VALID:
             $valid_items = explode(',', $this->getRuleValue());
             $valid = false;
             foreach ($valid_items as $item) {
                 if ($this->_name == self::RULE_STATUS_VALID) {
                     $fieldname = 'Status';
                     $fieldname_small = 'status';
                 } elseif ($this->_name == self::RULE_RESOLUTION_VALID) {
                     $fieldname = 'Resolution';
                     $fieldname_small = 'resolution';
                 } elseif ($this->_name == self::RULE_REPRODUCABILITY_VALID) {
                     $fieldname = 'Reproducability';
                     $fieldname_small = 'reproducability';
                 } elseif ($this->_name == self::RULE_PRIORITY_VALID) {
                     $fieldname = 'Priority';
                     $fieldname_small = 'priority';
                 }
                 if ($input instanceof TBGIssue) {
                     $type = "TBG{$fieldname}";
                     $getter = "get{$fieldname}";
                     if (TBGContext::factory()->{$type}((int) $item)->getID() == $input->{$getter}()->getID()) {
                         $valid = true;
                         break;
                     }
                 } elseif ($input instanceof TBGRequest) {
                     if ($input->getParameter("{$fieldname_small}_id") == $item) {
                         $valid = true;
                         break;
                     }
                 }
             }
             return $valid;
             break;
     }
 }
コード例 #7
0
                ?>
								<?php 
            }
            ?>
							</label>
							<?php 
            if ($rule->getRule() == TBGWorkflowTransitionValidationRule::RULE_STATUS_VALID) {
                $options = TBGStatus::getAll();
            } elseif ($rule->getRule() == TBGWorkflowTransitionValidationRule::RULE_PRIORITY_VALID) {
                $options = TBGPriority::getAll();
            } elseif ($rule->getRule() == TBGWorkflowTransitionValidationRule::RULE_RESOLUTION_VALID) {
                $options = TBGResolution::getAll();
            } elseif ($rule->getRule() == TBGWorkflowTransitionValidationRule::RULE_REPRODUCABILITY_VALID) {
                $options = TBGReproducability::getAll();
            } elseif ($rule->getRule() == TBGWorkflowTransitionValidationRule::RULE_TEAM_MEMBERSHIP_VALID) {
                $options = TBGTeam::getAll();
            }
            ?>
							<?php 
            foreach ($options as $option) {
                ?>
							<br><input type="checkbox" style="margin-left: 25px;" name="rule_value[<?php 
                echo $option->getID();
                ?>
]" value="<?php 
                echo $option->getID();
                ?>
"<?php 
                if ($rule->isValueValid($option->getID())) {
                    echo ' checked';
                }
コード例 #8
0
 public function componentWorkflowtransitionaction()
 {
     $available_assignees_users = array();
     foreach (TBGContext::getUser()->getTeams() as $team) {
         foreach ($team->getMembers() as $user) {
             $available_assignees_users[$user->getID()] = $user;
         }
     }
     foreach (TBGContext::getUser()->getFriends() as $user) {
         $available_assignees_users[$user->getID()] = $user;
     }
     $this->available_assignees_teams = TBGTeam::getAll();
     $this->available_assignees_users = $available_assignees_users;
 }