コード例 #1
0
 public function loadFixtures(TBGScope $scope)
 {
     foreach (TBGIssueTypesTable::getTable()->getAllIDsByScopeID($scope->getID()) as $issuetype_id) {
         $crit = $this->getCriteria();
         $crit->addInsert(self::SCOPE, $scope->getID());
         $crit->addInsert(self::WORKFLOW_ID, TBGSettings::getCoreWorkflow()->getID());
         $crit->addInsert(self::WORKFLOW_SCHEME_ID, TBGSettings::getCoreWorkflowScheme()->getID());
         $crit->addInsert(self::ISSUETYPE_ID, $issuetype_id);
         $this->doInsert($crit);
     }
 }
コード例 #2
0
ファイル: TBGGroup.class.php プロジェクト: oparoz/thebuggenie
 public static function loadFixtures(TBGScope $scope)
 {
     $scope_id = $scope->getID();
     $admin_group = new TBGGroup();
     $admin_group->setName('Administrators');
     $admin_group->setScope($scope);
     $admin_group->save();
     TBGSettings::saveSetting('admingroup', $admin_group->getID(), 'core', $scope_id);
     $user_group = new TBGGroup();
     $user_group->setName('Regular users');
     $user_group->setScope($scope);
     $user_group->save();
     TBGSettings::saveSetting('defaultgroup', $user_group->getID(), 'core', $scope_id);
     $guest_group = new TBGGroup();
     $guest_group->setName('Guests');
     $guest_group->setScope($scope);
     $guest_group->save();
     // Set up initial users, and their permissions
     if ($scope->isDefault()) {
         list($guestuser_id, $adminuser_id) = TBGUser::loadFixtures($scope, $admin_group, $user_group, $guest_group);
         TBGUserScopesTable::getTable()->addUserToScope($guestuser_id, $scope->getID(), $guest_group->getID(), true);
         TBGUserScopesTable::getTable()->addUserToScope($adminuser_id, $scope->getID(), $admin_group->getID(), true);
     } else {
         $default_scope_id = TBGSettings::getDefaultScopeID();
         $default_user_id = (int) TBGSettings::get(TBGSettings::SETTING_DEFAULT_USER_ID, 'core', $default_scope_id);
         TBGUserScopesTable::getTable()->addUserToScope($default_user_id, $scope->getID(), $user_group->getID(), true);
         TBGUserScopesTable::getTable()->addUserToScope(1, $scope->getID(), $admin_group->getID());
         TBGSettings::saveSetting(TBGSettings::SETTING_DEFAULT_USER_ID, $default_user_id, 'core', $scope->getID());
     }
     TBGPermissionsTable::getTable()->loadFixtures($scope, $admin_group->getID(), $guest_group->getID());
 }
コード例 #3
0
 public function loadFixtures(TBGScope $scope)
 {
     $i18n = TBGContext::getI18n();
     $crit = $this->getCriteria();
     $crit->addInsert(self::SCOPE, $scope->getID());
     $crit->addInsert(self::NAME, "Default workflow scheme");
     $crit->addInsert(self::DESCRIPTION, "This is the default workflow scheme. It is used by all projects with no specific workflow scheme selected. This scheme cannot be edited or removed.");
     $this->doInsert($crit);
 }
コード例 #4
0
 public static function loadFixtures(TBGScope $scope)
 {
     $scheme = new TBGIssuetypeScheme();
     $scheme->setScope($scope->getID());
     $scheme->setName("Default issuetype scheme");
     $scheme->setDescription("This is the default issuetype scheme. It is used by all projects with no specific issuetype scheme selected. This scheme cannot be edited or removed.");
     $scheme->save();
     TBGSettings::saveSetting(TBGSettings::SETTING_DEFAULT_ISSUETYPESCHEME, $scheme->getID(), 'core', $scope->getID());
     foreach (TBGIssuetype::getAll() as $issuetype) {
         $scheme->setIssuetypeEnabled($issuetype);
         if ($issuetype->getIcon() == 'developer_report') {
             $scheme->setIssuetypeRedirectedAfterReporting($issuetype, false);
         }
         if (in_array($issuetype->getIcon(), array('task', 'developer_report', 'idea'))) {
             $scheme->setIssuetypeReportable($issuetype, false);
         }
     }
     return $scheme;
 }
コード例 #5
0
 public static function loadFixtures(TBGScope $scope)
 {
     $scope_id = $scope->getID();
     $bug_report = new TBGIssuetype();
     $bug_report->setName('Bug report');
     $bug_report->setIcon('bug_report');
     $bug_report->setScope($scope_id);
     $bug_report->setDescription('Have you discovered a bug in the application, or is something not working as expected?');
     $bug_report->save();
     TBGSettings::saveSetting('defaultissuetypefornewissues', $bug_report->getID(), 'core', $scope_id);
     TBGSettings::saveSetting('issuetype_bug_report', $bug_report->getID(), 'core', $scope_id);
     $feature_request = new TBGIssuetype();
     $feature_request->setName('Feature request');
     $feature_request->setIcon('feature_request');
     $feature_request->setDescription('Are you missing some specific feature, or is your favourite part of the application a bit lacking?');
     $feature_request->setScope($scope_id);
     $feature_request->save();
     TBGSettings::saveSetting('issuetype_feature_request', $feature_request->getID(), 'core', $scope_id);
     $enhancement = new TBGIssuetype();
     $enhancement->setName('Enhancement');
     $enhancement->setIcon('enhancement');
     $enhancement->setDescription('Have you found something that is working in a way that could be improved?');
     $enhancement->setScope($scope_id);
     $enhancement->save();
     TBGSettings::saveSetting('issuetype_enhancement', $enhancement->getID(), 'core', $scope_id);
     $task = new TBGIssuetype();
     $task->setName('Task');
     $task->setIcon('task');
     $task->setIsTask();
     $task->setScope($scope_id);
     $task->save();
     TBGSettings::saveSetting('issuetype_task', $task->getID(), 'core', $scope_id);
     $user_story = new TBGIssuetype();
     $user_story->setName('User story');
     $user_story->setIcon('developer_report');
     $user_story->setDescription('Doing it Agile-style. Issue type perfectly suited for entering user stories');
     $user_story->setScope($scope_id);
     $user_story->save();
     TBGSettings::saveSetting('issuetype_user_story', $user_story->getID(), 'core', $scope_id);
     $idea = new TBGIssuetype();
     $idea->setName('Idea');
     $idea->setIcon('idea');
     $idea->setDescription('Express yourself - share your ideas with the rest of the team!');
     $idea->setScope($scope_id);
     $idea->save();
     TBGSettings::saveSetting('issuetype_idea', $idea->getID(), 'core', $scope_id);
     return array($bug_report->getID(), $feature_request->getID(), $enhancement->getID(), $task->getID(), $user_story->getID(), $idea->getID());
 }
コード例 #6
0
 public static function loadFixtures(TBGScope $scope)
 {
     $scope_id = $scope->getID();
     $admin_group = new TBGGroup();
     $admin_group->setName('Administrators');
     $admin_group->setScope($scope);
     $admin_group->save();
     TBGSettings::saveSetting('admingroup', $admin_group->getID(), 'core', $scope_id);
     $user_group = new TBGGroup();
     $user_group->setName('Regular users');
     $user_group->setScope($scope);
     $user_group->save();
     TBGSettings::saveSetting('defaultgroup', $user_group->getID(), 'core', $scope_id);
     $guest_group = new TBGGroup();
     $guest_group->setName('Guests');
     $guest_group->setScope($scope);
     $guest_group->save();
     // Set up initial users, and their permissions
     TBGUser::loadFixtures($scope, $admin_group, $user_group, $guest_group);
     TBGPermissionsTable::getTable()->loadFixtures($scope, $admin_group->getID(), $guest_group->getID());
 }
コード例 #7
0
 public function loadFixtures(TBGScope $scope)
 {
     $steps = array();
     $steps[] = array('name' => 'New', 'description' => 'A new issue, not yet handled', 'status_id' => TBGStatus::getStatusByKeyish('new')->getID(), 'editable' => true, 'is_closed' => false);
     $steps[] = array('name' => 'Investigating', 'description' => 'An issue that is being investigated, looked into or is by other means between new and unconfirmed state', 'status_id' => TBGStatus::getStatusByKeyish('investigating')->getID(), 'editable' => true, 'is_closed' => false);
     $steps[] = array('name' => 'Confirmed', 'description' => 'An issue that has been confirmed', 'status_id' => TBGStatus::getStatusByKeyish('confirmed')->getID(), 'editable' => false, 'is_closed' => false);
     $steps[] = array('name' => 'In progress', 'description' => 'An issue that is being adressed', 'status_id' => TBGStatus::getStatusByKeyish('beingworkedon')->getID(), 'editable' => false, 'is_closed' => false);
     $steps[] = array('name' => 'Ready for testing', 'description' => 'An issue that has been marked fixed and is ready for testing', 'status_id' => TBGStatus::getStatusByKeyish('readyfortesting/qa')->getID(), 'editable' => false, 'is_closed' => false);
     $steps[] = array('name' => 'Testing', 'description' => 'An issue where the proposed or implemented solution is currently being tested or approved', 'status_id' => TBGStatus::getStatusByKeyish('testing/qa')->getID(), 'editable' => false, 'is_closed' => false);
     $steps[] = array('name' => 'Rejected', 'description' => 'A closed issue that has been rejected', 'status_id' => TBGStatus::getStatusByKeyish('notabug')->getID(), 'editable' => false, 'is_closed' => true);
     $steps[] = array('name' => 'Closed', 'description' => 'A closed issue', 'status_id' => null, 'editable' => false, 'is_closed' => true);
     foreach ($steps as $step) {
         $crit = $this->getCriteria();
         $crit->addInsert(self::WORKFLOW_ID, 1);
         $crit->addInsert(self::SCOPE, $scope->getID());
         $crit->addInsert(self::NAME, $step['name']);
         $crit->addInsert(self::DESCRIPTION, $step['description']);
         $crit->addInsert(self::STATUS_ID, $step['status_id']);
         $crit->addInsert(self::CLOSED, $step['is_closed']);
         $crit->addInsert(self::EDITABLE, $step['editable']);
         $this->doInsert($crit);
     }
 }
コード例 #8
0
 public function loadFixtures(TBGScope $scope)
 {
     $i18n = TBGContext::getI18n();
     $settings = array();
     $settings[TBGSettings::SETTING_THEME_NAME] = 'oxygen';
     $settings[TBGSettings::SETTING_REQUIRE_LOGIN] = 0;
     $settings[TBGSettings::SETTING_DEFAULT_USER_IS_GUEST] = 1;
     $settings[TBGSettings::SETTING_ALLOW_REGISTRATION] = 1;
     $settings[TBGSettings::SETTING_RETURN_FROM_LOGIN] = 'referer';
     $settings[TBGSettings::SETTING_RETURN_FROM_LOGOUT] = 'home';
     $settings[TBGSettings::SETTING_SHOW_PROJECTS_OVERVIEW] = 1;
     $settings[TBGSettings::SETTING_ALLOW_USER_THEMES] = 0;
     $settings[TBGSettings::SETTING_ENABLE_UPLOADS] = 0;
     $settings[TBGSettings::SETTING_ENABLE_GRAVATARS] = 1;
     $settings[TBGSettings::SETTING_UPLOAD_RESTRICTION_MODE] = 'blacklist';
     $settings[TBGSettings::SETTING_UPLOAD_EXTENSIONS_LIST] = 'exe,bat,php,asp,jsp';
     $settings[TBGSettings::SETTING_UPLOAD_STORAGE] = 'files';
     $settings[TBGSettings::SETTING_UPLOAD_LOCAL_PATH] = THEBUGGENIE_PATH . 'files/';
     $settings[TBGSettings::SETTING_TBG_NAME] = 'The Bug Genie';
     $settings[TBGSettings::SETTING_TBG_TAGLINE] = '<b>Friendly</b> issue tracking and project management';
     $settings[TBGSettings::SETTING_SYNTAX_HIGHLIGHT_DEFAULT_LANGUAGE] = 'html4strict';
     $settings[TBGSettings::SETTING_SYNTAX_HIGHLIGHT_DEFAULT_NUMBERING] = '3';
     $settings[TBGSettings::SETTING_SYNTAX_HIGHLIGHT_DEFAULT_INTERVAL] = '10';
     $settings[TBGSettings::SETTING_SALT] = sha1(time() . mt_rand(1000, 10000));
     $scope_id = $scope->getID();
     foreach ($settings as $settings_name => $settings_val) {
         $this->saveSetting($settings_name, 'core', $settings_val, 0, $scope_id);
     }
 }
コード例 #9
0
ファイル: TBGUser.class.php プロジェクト: oparoz/thebuggenie
 public function isMemberOfScope(TBGScope $scope)
 {
     return array_key_exists($scope->getID(), $this->getScopes());
 }
コード例 #10
0
 public static function loadFixtures(TBGScope $scope)
 {
     $workflow = new TBGWorkflow();
     $workflow->setName("Default workflow");
     $workflow->setDescription("This is the default workflow. It is used by all projects with no specific workflow selected, and for issue types with no specific workflow specified. This workflow cannot be edited or removed.");
     $workflow->setScope($scope->getID());
     $workflow->save();
     TBGSettings::saveSetting(TBGSettings::SETTING_DEFAULT_WORKFLOW, $workflow->getID(), 'core', $scope->getID());
     TBGWorkflowStep::loadFixtures($scope, $workflow);
 }
コード例 #11
0
 public function loadFixtures(TBGScope $scope, $admin_group_id, $guest_group_id)
 {
     $scope_id = $scope->getID();
     $this->setPermission(0, $admin_group_id, 0, true, 'core', 'cansaveconfig', 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', 'page_account_access', 0, $scope_id);
     $this->setPermission(0, $guest_group_id, 0, false, 'core', 'page_account_access', 0, $scope_id);
     $this->setPermission(0, 0, 0, false, 'core', 'candoscrumplanning', 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', 'cancreateandeditissues', 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', 'canfindissuesandsavesearches', 0, $scope_id);
     $this->setPermission(0, 0, 0, false, 'core', 'cancreatepublicsearches', 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', 'cancreatepublicsearches', 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', 'caneditmainmenu', 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', 'caneditissuecustomfieldsown', 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', 'canpostandeditcomments', 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', 'canpostseeandeditallcomments', 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "canseeproject", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', 'candoscrumplanning', 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "page_project_allpages_access", 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', "page_home_access", 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', "page_about_access", 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', "page_dashboard_access", 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', "page_search_access", 0, $scope_id);
     $this->setPermission(0, 0, 0, true, 'core', 'page_confirm_scope_access', 0, $scope_id);
     $this->setPermission(0, $guest_group_id, 0, false, 'core', "page_dashboard_access", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "page_teamlist_access", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "page_clientlist_access", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "canvoteforissues", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "canlockandeditlockedissues", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "cancreateandeditissues", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "caneditissue", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "candeleteissues", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "caneditissuecustomfields", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "canaddextrainformationtoissues", 0, $scope_id);
     $this->setPermission(0, $admin_group_id, 0, true, 'core', "canpostseeandeditallcomments", 0, $scope_id);
 }
コード例 #12
0
 public function loadFixtures(TBGScope $scope)
 {
     $scope_id = $scope->getID();
     $this->addMainMenuLink('http://www.thebuggenie.com', 'The Bug Genie homepage', 1, $scope_id);
     $this->addMainMenuLink('http://forum.thebuggenie.com', 'The Bug Genie forums', 2, $scope_id);
     $this->addMainMenuLink(null, null, 3, $scope_id);
     $this->addMainMenuLink('http://issues.thebuggenie.com', 'Online issue tracker', 4, $scope_id);
     $this->addMainMenuLink('', "''This is the issue tracker for The Bug Genie''", 5, $scope_id);
     $this->addMainMenuLink(null, null, 6, $scope_id);
     $this->addMainMenuLink('http://thebuggenie.wordpress.com/', 'The Bug Genie team blog', 7, $scope_id);
     $this->addMainMenuLink('', "''Stay up to date on the latest development''", 8, $scope_id);
 }
コード例 #13
0
 public static function loadFixtures(TBGScope $scope)
 {
     $available = new TBGUserstate();
     $available->setIsOnline();
     $available->setName('Available');
     $available->save();
     $offline = new TBGUserstate();
     $offline->setIsUnavailable();
     $offline->setName('Offline');
     $offline->save();
     $busy = new TBGUserstate();
     $busy->setIsUnavailable();
     $busy->setIsOnline();
     $busy->setName('Busy');
     $busy->save();
     $unavailable = new TBGUserstate();
     $unavailable->setIsUnavailable();
     $unavailable->setIsOnline();
     $unavailable->setName('Unavailable');
     $unavailable->save();
     $in_a_meeting = new TBGUserstate();
     $in_a_meeting->setIsUnavailable();
     $in_a_meeting->setIsInMeeting();
     $in_a_meeting->setName('In a meeting');
     $in_a_meeting->save();
     $coding = new TBGUserstate();
     $coding->setIsUnavailable();
     $coding->setIsBusy();
     $coding->setIsOnline();
     $coding->setName('Coding');
     $coding->save();
     $coffee = new TBGUserstate();
     $coffee->setIsUnavailable();
     $coffee->setIsBusy();
     $coffee->setIsOnline();
     $coffee->setName('On coffee break');
     $away = new TBGUserstate();
     $away->setIsUnavailable();
     $away->setIsOnline();
     $away->setIsBusy();
     $away->setIsAbsent();
     $away->setName('Away');
     $away->save();
     $vacation = new TBGUserstate();
     $vacation->setIsUnavailable();
     $vacation->setIsBusy();
     $vacation->setIsAbsent();
     $vacation->setName('On vacation');
     $vacation->save();
     TBGSettings::saveSetting(TBGSettings::SETTING_ONLINESTATE, $available->getID(), 'core', $scope->getID());
     TBGSettings::saveSetting(TBGSettings::SETTING_OFFLINESTATE, $offline->getID(), 'core', $scope->getID());
     TBGSettings::saveSetting(TBGSettings::SETTING_AWAYSTATE, $away->getID(), 'core', $scope->getID());
 }