public static function getAvailablePostValidationRules() { $initial_list = array(); $i18n = framework\Context::getI18n(); $initial_list[self::RULE_PRIORITY_VALID] = $i18n->__('Validate specified priority'); $initial_list[self::RULE_REPRODUCABILITY_VALID] = $i18n->__('Validate specified reproducability'); $initial_list[self::RULE_RESOLUTION_VALID] = $i18n->__('Validate specified resolution'); $initial_list[self::RULE_STATUS_VALID] = $i18n->__('Validate specified status'); foreach (CustomDatatype::getAll() as $key => $details) { $initial_list[self::CUSTOMFIELD_VALIDATE_PREFIX . $key] = $i18n->__('Validate specified %key', array('%key' => $key)); } $initial_list[self::RULE_TEAM_MEMBERSHIP_VALID] = $i18n->__('Validate team membership of assignee'); $event = new \thebuggenie\core\framework\Event('core', 'WorkflowTransitionValidationRule::getAvailablePostValidationRules', null, array(), $initial_list); $event->trigger(); return $event->getReturnList(); }
public static function getAvailableFields($builtin_only = false) { $builtin_types = array('shortname', 'description', 'reproduction_steps', 'status', 'category', 'resolution', 'priority', 'reproducability', 'percent_complete', 'severity', 'owned_by', 'assignee', 'edition', 'build', 'component', 'estimated_time', 'spent_time', 'milestone', 'user_pain', 'votes'); if ($builtin_only) { return $builtin_types; } $customtypes = CustomDatatype::getAll(); $types = array_merge($builtin_types, array_keys($customtypes)); return $types; }
protected static function _cacheAvailablePermissions() { if (self::$_available_permissions === null) { $i18n = self::getI18n(); self::$_available_permissions = array('user' => array(), 'general' => array(), 'project' => array()); self::$_available_permissions['user']['canseeallissues'] = array('description' => $i18n->__('Can see issues reported by other users'), 'mode' => 'permissive'); self::$_available_permissions['user']['canseegroupissues'] = array('description' => $i18n->__('Can see issues reported by users in the same group'), 'mode' => 'permissive'); self::$_available_permissions['configuration']['cansaveconfig'] = array('description' => $i18n->__('Can access the configuration page and edit all configuration'), 'details' => array()); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Settings" configuration page'), 'target_id' => 12)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Settings" configuration page'), 'target_id' => 12)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Permissions" configuration page'), 'target_id' => 5)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Permissions" configuration page'), 'target_id' => 5)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Uploads" configuration page'), 'target_id' => 3)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Uploads" configuration page'), 'target_id' => 3)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Scopes" configuration page'), 'target_id' => 14)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Scopes" configuration page'), 'target_id' => 14)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Import" configuration page'), 'target_id' => 16)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Import" configuration page'), 'target_id' => 16)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Projects" configuration page'), 'target_id' => 10)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Projects" configuration page'), 'target_id' => 10)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Issue types" configuration page'), 'target_id' => 6)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Issue types" configuration page'), 'target_id' => 6)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Issue fields" configuration page'), 'target_id' => 4)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Issue fields" configuration page'), 'target_id' => 4)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Users, teams and groups" configuration page'), 'target_id' => 2)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Users, teams and groups" configuration page'), 'target_id' => 2)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Modules" and any module configuration page'), 'target_id' => 15)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Modules" configuration page and any modules'), 'target_id' => 15)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('canviewconfig' => array('description' => $i18n->__('Read-only access: "Themes" configuration page and any themes'), 'target_id' => 19)); self::$_available_permissions['configuration']['cansaveconfig']['details'][] = array('cansaveconfig' => array('description' => $i18n->__('Read + write access: "Themes" configuration page and any themes'), 'target_id' => 19)); self::$_available_permissions['general']['canfindissuesandsavesearches'] = array('description' => $i18n->__('Can search for issues and create saved searches'), 'details' => array()); self::$_available_permissions['general']['canfindissuesandsavesearches']['details']['canfindissues'] = array('description' => $i18n->__('Can search for issues')); self::$_available_permissions['general']['canfindissuesandsavesearches']['details']['cancreatepublicsearches'] = array('description' => $i18n->__('Can create saved searches that are public')); self::$_available_permissions['general']['caneditmainmenu'] = array('description' => $i18n->__('Can edit main menu')); self::$_available_permissions['pages']['page_home_access'] = array('description' => $i18n->__('Can access the frontpage')); self::$_available_permissions['pages']['page_dashboard_access'] = array('description' => $i18n->__('Can access the user dashboard')); self::$_available_permissions['pages']['page_search_access'] = array('description' => $i18n->__('Can access the search page')); self::$_available_permissions['pages']['page_about_access'] = array('description' => $i18n->__('Can access the "About" page')); self::$_available_permissions['pages']['page_account_access'] = array('description' => $i18n->__('Can access the "My account" page'), 'details' => array()); self::$_available_permissions['pages']['page_account_access']['details']['canchangepassword'] = array('description' => $i18n->__('Can change own password'), 'mode' => 'permissive'); self::$_available_permissions['pages']['page_teamlist_access'] = array('description' => $i18n->__('Can see list of teams in header menu')); self::$_available_permissions['pages']['page_clientlist_access'] = array('description' => $i18n->__('Can access all clients')); self::$_available_permissions['project_pages']['page_project_allpages_access'] = array('description' => $i18n->__('Can access all project pages'), 'details' => array()); self::$_available_permissions['project_pages']['page_project_allpages_access']['details']['page_project_dashboard_access'] = array('description' => $i18n->__('Can access the project dashboard')); self::$_available_permissions['project_pages']['page_project_allpages_access']['details']['page_project_planning_access'] = array('description' => $i18n->__('Can access the project planning page')); self::$_available_permissions['project_pages']['page_project_allpages_access']['details']['page_project_scrum_access'] = array('description' => $i18n->__('Can access the project scrum page')); self::$_available_permissions['project_pages']['page_project_allpages_access']['details']['page_project_issues_access'] = array('description' => $i18n->__('Can access the project issues search page')); self::$_available_permissions['project_pages']['page_project_allpages_access']['details']['page_project_roadmap_access'] = array('description' => $i18n->__('Can access the project roadmap page')); self::$_available_permissions['project_pages']['page_project_allpages_access']['details']['page_project_team_access'] = array('description' => $i18n->__('Can access the project team page')); self::$_available_permissions['project_pages']['page_project_allpages_access']['details']['page_project_statistics_access'] = array('description' => $i18n->__('Can access the project statistics page')); self::$_available_permissions['project_pages']['page_project_allpages_access']['details']['page_project_timeline_access'] = array('description' => $i18n->__('Can access the project timeline page')); self::$_available_permissions['project']['canseeproject'] = array('description' => $i18n->__('Can see that project exists')); self::$_available_permissions['project']['canseeprojecthierarchy'] = array('description' => $i18n->__('Can see complete project hierarchy')); self::$_available_permissions['project']['canseeprojecthierarchy']['details']['canseeallprojecteditions'] = array('description' => $i18n->__('Can see all editions')); self::$_available_permissions['project']['canseeprojecthierarchy']['details']['canseeallprojectcomponents'] = array('description' => $i18n->__('Can see all components')); self::$_available_permissions['project']['canseeprojecthierarchy']['details']['canseeallprojectbuilds'] = array('description' => $i18n->__('Can see all releases')); self::$_available_permissions['project']['canseeprojecthierarchy']['details']['canseeallprojectmilestones'] = array('description' => $i18n->__('Can see all milestones')); self::$_available_permissions['project']['candoscrumplanning'] = array('description' => $i18n->__('Can manage stories, tasks, sprints and backlog on the project planning page'), 'details' => array()); self::$_available_permissions['project']['candoscrumplanning']['details']['canaddscrumsprints'] = array('description' => $i18n->__('Can add milestones/sprints on the project planning page')); self::$_available_permissions['project']['candoscrumplanning']['details']['canassignscrumuserstoriestosprints'] = array('description' => $i18n->__('Can (re-)assign issues/tasks/stories to milestones/sprints/backlog on the project planning page')); self::$_available_permissions['project']['canmanageproject'] = array('description' => $i18n->__('Can manage project')); self::$_available_permissions['project']['canmanageproject']['details']['canmanageprojectreleases'] = array('description' => $i18n->__('Can manage project releases and components')); self::$_available_permissions['project']['canmanageproject']['details']['caneditprojectdetails'] = array('description' => $i18n->__('Can edit project details and settings')); self::$_available_permissions['edition']['canseeedition'] = array('description' => $i18n->__('Can see this edition')); self::$_available_permissions['component']['canseecomponent'] = array('description' => $i18n->__('Can see this component')); self::$_available_permissions['build']['canseebuild'] = array('description' => $i18n->__('Can see this release')); self::$_available_permissions['milestone']['canseemilestone'] = array('description' => $i18n->__('Can see this milestone')); self::$_available_permissions['issues']['canvoteforissues'] = array('description' => $i18n->__('Can vote for issues')); self::$_available_permissions['issues']['canlockandeditlockedissues'] = array('description' => $i18n->__('Can toggle issue access between restricted and public')); self::$_available_permissions['issues']['cancreateandeditissues'] = array('description' => $i18n->__('Can create issues, edit basic information on issues reported by the user and close/re-open them'), 'details' => array()); self::$_available_permissions['issues']['cancreateandeditissues']['details']['cancreateissues'] = array('description' => $i18n->__('Can create new issues'), 'details' => array()); self::$_available_permissions['issues']['cancreateandeditissues']['details']['caneditissuebasicown'] = array('description' => $i18n->__('Can edit title and description on issues reported by the user'), 'details' => array()); self::$_available_permissions['issues']['cancreateandeditissues']['details']['caneditissuebasicown']['details']['caneditissuetitleown'] = array('description' => $i18n->__('Can edit issue title on issues reported by the user')); self::$_available_permissions['issues']['cancreateandeditissues']['details']['caneditissuebasicown']['details']['caneditissuedescriptionown'] = array('description' => $i18n->__('Can edit issue description on issues reported by the user')); self::$_available_permissions['issues']['cancreateandeditissues']['details']['caneditissuebasicown']['details']['caneditissuereproduction_stepsown'] = array('description' => $i18n->__('Can edit steps to reproduce on issues reported by the user')); self::$_available_permissions['issues']['cancreateandeditissues']['details']['canclosereopenissuesown'] = array('description' => $i18n->__('Can close and reopen issues reported by the user'), 'details' => array()); self::$_available_permissions['issues']['cancreateandeditissues']['details']['canclosereopenissuesown']['details']['cancloseissuesown'] = array('description' => $i18n->__('Can close issues reported by the user')); self::$_available_permissions['issues']['cancreateandeditissues']['details']['canclosereopenissuesown']['details']['canreopenissuesown'] = array('description' => $i18n->__('Can re-open issues reported by the user')); self::$_available_permissions['issues']['caneditissue'] = array('description' => $i18n->__('Can delete, close, reopen and update any issue details and progress'), 'details' => array()); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuebasic'] = array('description' => $i18n->__('Can edit title and description on any issues'), 'details' => array()); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuebasic']['details']['caneditissuetitle'] = array('description' => $i18n->__('Can edit any issue title')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuebasic']['details']['caneditissuedescription'] = array('description' => $i18n->__('Can edit any issue description')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuebasic']['details']['caneditissuereproduction_steps'] = array('description' => $i18n->__('Can edit any issue steps to reproduce')); self::$_available_permissions['issues']['caneditissue']['details']['candeleteissues'] = array('description' => $i18n->__('Can delete issues')); self::$_available_permissions['issues']['caneditissue']['details']['canclosereopenissues'] = array('description' => $i18n->__('Can close any issues')); self::$_available_permissions['issues']['caneditissue']['details']['canclosereopenissues']['details']['cancloseissues'] = array('description' => $i18n->__('Can close any issues')); self::$_available_permissions['issues']['caneditissue']['details']['canclosereopenissues']['details']['canreopenissues'] = array('description' => $i18n->__('Can re-open any issues')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissueposted_by'] = array('description' => $i18n->__('Can edit issue posted by')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissueowned_by'] = array('description' => $i18n->__('Can edit issue owned by')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissueassigned_to'] = array('description' => $i18n->__('Can edit issue assigned_to')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuestatus'] = array('description' => $i18n->__('Can edit issue status')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuecategory'] = array('description' => $i18n->__('Can edit issue category')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuepriority'] = array('description' => $i18n->__('Can edit issue priority')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissueseverity'] = array('description' => $i18n->__('Can edit issue severity')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuereproducability'] = array('description' => $i18n->__('Can edit issue reproducability')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissueresolution'] = array('description' => $i18n->__('Can edit issue resolution')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissueestimated_time'] = array('description' => $i18n->__('Can estimate issues')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuespent_time'] = array('description' => $i18n->__('Can spend time working on issues')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuepercent_complete'] = array('description' => $i18n->__('Can edit issue percent complete')); self::$_available_permissions['issues']['caneditissue']['details']['caneditissuemilestone'] = array('description' => $i18n->__('Can set issue milestone')); self::$_available_permissions['issues']['caneditissuecustomfieldsown'] = array('description' => $i18n->__('Can change custom field values for issues reported by the user'), 'details' => array()); self::$_available_permissions['issues']['caneditissuecustomfields'] = array('description' => $i18n->__('Can change custom field values for any issues'), 'details' => array()); foreach (\thebuggenie\core\entities\CustomDatatype::getAll() as $cdf) { self::$_available_permissions['issues']['caneditissuecustomfieldsown']['details']['caneditissuecustomfields' . $cdf->getKey() . 'own'] = array('description' => $i18n->__('Can change custom field "%field_name" for issues reported by the user', array('%field_name' => $i18n->__($cdf->getDescription())))); self::$_available_permissions['issues']['caneditissuecustomfields']['details']['caneditissuecustomfields' . $cdf->getKey()] = array('description' => $i18n->__('Can change custom field "%field_name" for any issues', array('%field_name' => $i18n->__($cdf->getDescription())))); // Set permissions for custom option types if ($cdf->hasCustomOptions()) { $options = $cdf->getOptions(); foreach ($options as $option) { self::$_available_permissions['issues']['set_datatype_' . $option->getID()] = array('description' => $i18n->__('Can change issue field to "%option_name" for issues reported by the user', array('%option_name' => $i18n->__($option->getValue())))); } //endforeach } //endif } foreach (\thebuggenie\core\entities\Datatype::getTypes() as $type => $class) { self::$_available_permissions['issues']['set_datatype_' . $type] = array('description' => $i18n->__('Can change issue field "%type_name" for issues reported by the user', array('%type_name' => $i18n->__($type)))); } self::$_available_permissions['issues']['canaddextrainformationtoissues'] = array('description' => $i18n->__('Can add/remove extra information and link issues (edition, component, release, links and files) to issues'), 'details' => array()); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddbuildsown'] = array('description' => $i18n->__('Can add releases / versions to list of affected versions for issues reported by the user')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddbuilds'] = array('description' => $i18n->__('Can add releases / versions to list of affected versions for any issues')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddcomponentsown'] = array('description' => $i18n->__('Can add components to list of affected components for issues reported by the user')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddcomponents'] = array('description' => $i18n->__('Can add components to list of affected components for any issues')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddeditionsown'] = array('description' => $i18n->__('Can add editions to list of affected editions for issues reported by the user')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddeditions'] = array('description' => $i18n->__('Can add editions to list of affected editions for any issues')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddlinkstoissuesown'] = array('description' => $i18n->__('Can add links to issues reported by the user')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddlinkstoissues'] = array('description' => $i18n->__('Can add links to any issues')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddfilestoissuesown'] = array('description' => $i18n->__('Can add files to and remove own files from issues reported by the user')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddfilestoissues'] = array('description' => $i18n->__('Can add files to and remove own files from any issues')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canremovefilesfromissuesown'] = array('description' => $i18n->__('Can remove any attachments from issues reported by the user')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canremovefilesfromissues'] = array('description' => $i18n->__('Can remove any attachments from any issues')); self::$_available_permissions['issues']['canaddextrainformationtoissues']['details']['canaddrelatedissues'] = array('description' => $i18n->__('Can add related issues to other issues')); self::$_available_permissions['issues']['canpostandeditcomments'] = array('description' => $i18n->__('Can see public comments, post new, edit own and delete own comments'), 'details' => array()); self::$_available_permissions['issues']['canpostandeditcomments']['details']['canviewcomments'] = array('description' => $i18n->__('Can see public comments')); self::$_available_permissions['issues']['canpostandeditcomments']['details']['canpostcomments'] = array('description' => $i18n->__('Can post comments')); self::$_available_permissions['issues']['canpostandeditcomments']['details']['caneditcommentsown'] = array('description' => $i18n->__('Can edit own comments')); self::$_available_permissions['issues']['canpostandeditcomments']['details']['candeletecommentsown'] = array('description' => $i18n->__('Can delete own comments')); self::$_available_permissions['issues']['canpostseeandeditallcomments'] = array('description' => $i18n->__('Can see all comments (including non-public), post new, edit and delete all comments'), 'details' => array()); self::$_available_permissions['issues']['canpostseeandeditallcomments']['details']['canseenonpubliccomments'] = array('description' => $i18n->__('Can see all comments including hidden')); self::$_available_permissions['issues']['canpostseeandeditallcomments']['details']['caneditcomments'] = array('description' => $i18n->__('Can edit all comments')); self::$_available_permissions['issues']['canpostseeandeditallcomments']['details']['candeletecomments'] = array('description' => $i18n->__('Can delete any comments')); //self::trigger('core', 'cachepermissions', array('permissions' => &self::$_available_permissions)); } }
protected static function _populateAvailableActions() { if (self::$_available_actions === null) { $initial_list = array('special' => array(), 'set' => array(), 'clear' => array()); $i18n = framework\Context::getI18n(); $initial_list['special'][self::ACTION_ASSIGN_ISSUE] = $i18n->__('Assign the issue to a user'); $initial_list['special'][self::ACTION_ASSIGN_ISSUE_SELF] = $i18n->__('Assign the issue to the current user'); $initial_list['special'][self::ACTION_CLEAR_DUPLICATE] = $i18n->__('Mark as not duplicate'); $initial_list['special'][self::ACTION_SET_DUPLICATE] = $i18n->__('Possibly mark as duplicate'); $initial_list['special'][self::ACTION_USER_START_WORKING] = $i18n->__('Start logging time'); $initial_list['special'][self::ACTION_USER_STOP_WORKING] = $i18n->__('Stop logging time and optionally add time spent'); $initial_list['clear'][self::ACTION_CLEAR_ASSIGNEE] = $i18n->__('Clear issue assignee'); $initial_list['clear'][self::ACTION_CLEAR_PRIORITY] = $i18n->__('Clear issue priority'); $initial_list['clear'][self::ACTION_CLEAR_PERCENT] = $i18n->__('Clear issue percent'); $initial_list['clear'][self::ACTION_CLEAR_REPRODUCABILITY] = $i18n->__('Clear issue reproducability'); $initial_list['clear'][self::ACTION_CLEAR_RESOLUTION] = $i18n->__('Clear issue resolution'); $initial_list['clear'][self::ACTION_CLEAR_MILESTONE] = $i18n->__('Clear issue milestone'); $initial_list['set'][self::ACTION_SET_PRIORITY] = $i18n->__('Set issue priority'); $initial_list['set'][self::ACTION_SET_PERCENT] = $i18n->__('Set issue percent'); $initial_list['set'][self::ACTION_SET_REPRODUCABILITY] = $i18n->__('Set issue reproducability'); $initial_list['set'][self::ACTION_SET_RESOLUTION] = $i18n->__('Set issue resolution'); $initial_list['set'][self::ACTION_SET_STATUS] = $i18n->__('Set issue status'); $initial_list['set'][self::ACTION_SET_MILESTONE] = $i18n->__('Set issue milestone'); foreach (CustomDatatype::getAll() as $key => $details) { $initial_list['clear'][self::CUSTOMFIELD_CLEAR_PREFIX . $key] = $i18n->__('Clear issue field %key', array('%key' => $key)); $initial_list['set'][self::CUSTOMFIELD_SET_PREFIX . $key] = $i18n->__('Set issue field %key', array('%key' => $key)); } $event = new \thebuggenie\core\framework\Event('core', 'WorkflowTransitionAction::getAvailableTransitionActions', null, array(), $initial_list); $event->trigger(); self::$_available_actions = $event->getReturnList(); } }
"><?php echo $severity->getName(); ?> </option> <?php } ?> </select> <a href="javascript:void(0);" class="img" onclick="$('severity_link').show();$('severity_additional_div').hide();$('severity_id_additional').setValue(0);"><?php echo image_tag('undo.png', array('style' => 'float: none; margin-left: 5px;')); ?> </a> </div> </li> <?php foreach (\thebuggenie\core\entities\CustomDatatype::getAll() as $customdatatype) { ?> <li id="<?php echo $customdatatype->getKey(); ?> _additional" style="display: none;"> <?php echo image_tag('icon_customdatatype.png'); ?> <div id="<?php echo $customdatatype->getKey(); ?> _link"<?php if ($selected_customdatatype[$customdatatype->getKey()] !== null) { ?> style="display: none;"<?php
protected function _setupReportIssueProperties() { $this->locked_issuetype = $this->locked_issuetype ?: null; $this->selected_issuetype = $this->selected_issuetype ?: null; $this->selected_edition = $this->selected_edition ?: null; $this->selected_build = $this->selected_build ?: null; $this->selected_milestone = $this->selected_milestone ?: null; $this->parent_issue = $this->parent_issue ?: null; $this->selected_component = $this->selected_component ?: null; $this->selected_category = $this->selected_category ?: null; $this->selected_status = $this->selected_status ?: null; $this->selected_resolution = $this->selected_resolution ?: null; $this->selected_priority = $this->selected_priority ?: null; $this->selected_reproducability = $this->selected_reproducability ?: null; $this->selected_severity = $this->selected_severity ?: null; $this->selected_estimated_time = $this->selected_estimated_time ?: null; $this->selected_spent_time = $this->selected_spent_time ?: null; $this->selected_percent_complete = $this->selected_percent_complete ?: null; $this->selected_pain_bug_type = $this->selected_pain_bug_type ?: null; $this->selected_pain_likelihood = $this->selected_pain_likelihood ?: null; $this->selected_pain_effect = $this->selected_pain_effect ?: null; $selected_customdatatype = $this->selected_customdatatype ?: array(); foreach (entities\CustomDatatype::getAll() as $customdatatype) { $selected_customdatatype[$customdatatype->getKey()] = isset($selected_customdatatype[$customdatatype->getKey()]) ? $selected_customdatatype[$customdatatype->getKey()] : null; } $this->selected_customdatatype = $selected_customdatatype; $this->issuetype_id = $this->issuetype_id ?: null; $this->issue = $this->issue ?: null; $this->categories = entities\Category::getAll(); $this->severities = entities\Severity::getAll(); $this->priorities = entities\Priority::getAll(); $this->reproducabilities = entities\Reproducability::getAll(); $this->resolutions = entities\Resolution::getAll(); $this->statuses = entities\Status::getAll(); $this->milestones = framework\Context::getCurrentProject()->getMilestonesForIssues(); $this->al_items = array(); }
/** * Configure issue fields * * @param framework\Request $request The request object */ public function runConfigureIssuefields(framework\Request $request) { $i18n = framework\Context::getI18n(); $builtin_types = array(); $builtin_types[entities\Datatype::STATUS] = array('description' => $i18n->__('Status types'), 'key' => entities\Datatype::STATUS); $builtin_types[entities\Datatype::RESOLUTION] = array('description' => $i18n->__('Resolution types'), 'key' => entities\Datatype::RESOLUTION); $builtin_types[entities\Datatype::PRIORITY] = array('description' => $i18n->__('Priority levels'), 'key' => entities\Datatype::PRIORITY); $builtin_types[entities\Datatype::SEVERITY] = array('description' => $i18n->__('Severity levels'), 'key' => entities\Datatype::SEVERITY); $builtin_types[entities\Datatype::CATEGORY] = array('description' => $i18n->__('Categories'), 'key' => entities\Datatype::CATEGORY); $builtin_types[entities\Datatype::REPRODUCABILITY] = array('description' => $i18n->__('Reproducability'), 'key' => entities\Datatype::REPRODUCABILITY); $builtin_types[entities\Datatype::ACTIVITYTYPE] = array('description' => $i18n->__('Activity types'), 'key' => entities\Datatype::ACTIVITYTYPE); $this->builtin_types = $builtin_types; $this->custom_types = entities\CustomDatatype::getAll(); }
public function componentResults_normal_sheet() { $this->custom_columns = entities\CustomDatatype::getAll(); $this->cc = isset($this->cc) ? $this->cc : 0; require realpath(THEBUGGENIE_VENDOR_PATH) . DS . 'phpoffice' . DS . 'phpexcel' . DS . 'Classes' . DS . 'PHPExcel.php'; $phpexcel = new \PHPExcel(); foreach ($phpexcel->getAllSheets() as $index => $sheet) { $phpexcel->removeSheetByIndex($index); } $this->phpexcel = $phpexcel; $this->sheet = $phpexcel->createSheet(); }
protected function _saveCustomFieldValues() { foreach (CustomDatatype::getAll() as $key => $customdatatype) { switch ($customdatatype->getType()) { case CustomDatatype::INPUT_TEXT: case CustomDatatype::INPUT_TEXTAREA_SMALL: case CustomDatatype::INPUT_TEXTAREA_MAIN: case CustomDatatype::DATE_PICKER: $option_id = $this->getCustomField($key); tables\IssueCustomFields::getTable()->saveIssueCustomFieldValue($option_id, $customdatatype->getID(), $this->getID()); break; case CustomDatatype::EDITIONS_CHOICE: case CustomDatatype::COMPONENTS_CHOICE: case CustomDatatype::RELEASES_CHOICE: case CustomDatatype::MILESTONE_CHOICE: case CustomDatatype::STATUS_CHOICE: case CustomDatatype::USER_CHOICE: case CustomDatatype::TEAM_CHOICE: case CustomDatatype::CLIENT_CHOICE: $option_object = null; try { switch ($customdatatype->getType()) { case CustomDatatype::EDITIONS_CHOICE: case CustomDatatype::COMPONENTS_CHOICE: case CustomDatatype::RELEASES_CHOICE: case CustomDatatype::MILESTONE_CHOICE: case CustomDatatype::CLIENT_CHOICE: case CustomDatatype::STATUS_CHOICE: case CustomDatatype::USER_CHOICE: case CustomDatatype::TEAM_CHOICE: $option_object = $this->getCustomField($key); break; } } catch (\Exception $e) { } $option_id = is_object($option_object) ? $option_object->getID() : null; tables\IssueCustomFields::getTable()->saveIssueCustomFieldOption($option_id, $customdatatype->getID(), $this->getID()); break; default: $option_id = $this->getCustomField($key) instanceof \thebuggenie\core\entities\CustomDatatypeOption ? $this->getCustomField($key)->getID() : null; tables\IssueCustomFields::getTable()->saveIssueCustomFieldOption($option_id, $customdatatype->getID(), $this->getID()); break; } } }
protected function _postIssue(framework\Request $request) { $fields_array = $this->selected_project->getReportableFieldsArray($this->issuetype_id); $issue = new entities\Issue(); $issue->setTitle($this->title); $issue->setIssuetype($this->issuetype_id); $issue->setProject($this->selected_project); if (isset($fields_array['shortname'])) { $issue->setShortname($this->selected_shortname); } if (isset($fields_array['description'])) { $issue->setDescription($this->selected_description); $issue->setDescriptionSyntax($this->selected_description_syntax); } if (isset($fields_array['reproduction_steps'])) { $issue->setReproductionSteps($this->selected_reproduction_steps); $issue->setReproductionStepsSyntax($this->selected_reproduction_steps_syntax); } if (isset($fields_array['category']) && $this->selected_category instanceof entities\Datatype) { $issue->setCategory($this->selected_category->getID()); } if (isset($fields_array['status']) && $this->selected_status instanceof entities\Datatype) { $issue->setStatus($this->selected_status->getID()); } if (isset($fields_array['reproducability']) && $this->selected_reproducability instanceof entities\Datatype) { $issue->setReproducability($this->selected_reproducability->getID()); } if (isset($fields_array['resolution']) && $this->selected_resolution instanceof entities\Datatype) { $issue->setResolution($this->selected_resolution->getID()); } if (isset($fields_array['severity']) && $this->selected_severity instanceof entities\Datatype) { $issue->setSeverity($this->selected_severity->getID()); } if (isset($fields_array['priority']) && $this->selected_priority instanceof entities\Datatype) { $issue->setPriority($this->selected_priority->getID()); } if (isset($fields_array['estimated_time'])) { $issue->setEstimatedTime($this->selected_estimated_time); } if (isset($fields_array['spent_time'])) { $issue->setSpentTime($this->selected_spent_time); } if (isset($fields_array['milestone']) || isset($this->selected_milestone)) { $issue->setMilestone($this->selected_milestone); } if (isset($fields_array['percent_complete'])) { $issue->setPercentCompleted($this->selected_percent_complete); } if (isset($fields_array['pain_bug_type'])) { $issue->setPainBugType($this->selected_pain_bug_type); } if (isset($fields_array['pain_likelihood'])) { $issue->setPainLikelihood($this->selected_pain_likelihood); } if (isset($fields_array['pain_effect'])) { $issue->setPainEffect($this->selected_pain_effect); } foreach (entities\CustomDatatype::getAll() as $customdatatype) { if (!isset($fields_array[$customdatatype->getKey()])) { continue; } if ($customdatatype->hasCustomOptions()) { if (isset($fields_array[$customdatatype->getKey()]) && $this->selected_customdatatype[$customdatatype->getKey()] instanceof entities\CustomDatatypeOption) { $selected_option = $this->selected_customdatatype[$customdatatype->getKey()]; $issue->setCustomField($customdatatype->getKey(), $selected_option->getID()); } } else { $issue->setCustomField($customdatatype->getKey(), $this->selected_customdatatype[$customdatatype->getKey()]); } } // FIXME: If we set the issue assignee during report issue, this needs to be set INSTEAD of this if ($this->selected_project->canAutoassign()) { if (isset($fields_array['component']) && $this->selected_component instanceof entities\Component && $this->selected_component->hasLeader()) { $issue->setAssignee($this->selected_component->getLeader()); } elseif (isset($fields_array['edition']) && $this->selected_edition instanceof entities\Edition && $this->selected_edition->hasLeader()) { $issue->setAssignee($this->selected_edition->getLeader()); } elseif ($this->selected_project->hasLeader()) { $issue->setAssignee($this->selected_project->getLeader()); } } if ($request->hasParameter('custom_issue_access') && $this->selected_project->permissionCheck('canlockandeditlockedissues')) { switch ($request->getParameter('issue_access')) { case 'public': case 'public_category': $issue->setLocked(false); $issue->setLockedCategory($request->hasParameter('public_category')); break; case 'restricted': $issue->setLocked(); break; } } else { $issue->setLockedFromProject($this->selected_project); } framework\Event::listen('core', 'thebuggenie\\core\\entities\\Issue::createNew_pre_notifications', array($this, 'listen_issueCreate')); $issue->save(); if (isset($this->parent_issue)) { $issue->addParentIssue($this->parent_issue); } if (isset($fields_array['edition']) && $this->selected_edition instanceof entities\Edition) { $issue->addAffectedEdition($this->selected_edition); } if (isset($fields_array['build']) && $this->selected_build instanceof entities\Build) { $issue->addAffectedBuild($this->selected_build); } if (isset($fields_array['component']) && $this->selected_component instanceof entities\Component) { $issue->addAffectedComponent($this->selected_component); } return $issue; }
protected function _postIssue() { $fields_array = $this->selected_project->getReportableFieldsArray($this->issuetype_id); $issue = new entities\Issue(); $issue->setTitle($this->title); $issue->setIssuetype($this->issuetype_id); $issue->setProject($this->selected_project); if (isset($fields_array['shortname'])) { $issue->setShortname($this->selected_shortname); } if (isset($fields_array['description'])) { $issue->setDescription($this->selected_description); $issue->setDescriptionSyntax($this->selected_description_syntax); } if (isset($fields_array['reproduction_steps'])) { $issue->setReproductionSteps($this->selected_reproduction_steps); $issue->setReproductionStepsSyntax($this->selected_reproduction_steps_syntax); } if (isset($fields_array['category']) && $this->selected_category instanceof entities\Datatype) { $issue->setCategory($this->selected_category->getID()); } if (isset($fields_array['status']) && $this->selected_status instanceof entities\Datatype) { $issue->setStatus($this->selected_status->getID()); } if (isset($fields_array['reproducability']) && $this->selected_reproducability instanceof entities\Datatype) { $issue->setReproducability($this->selected_reproducability->getID()); } if (isset($fields_array['resolution']) && $this->selected_resolution instanceof entities\Datatype) { $issue->setResolution($this->selected_resolution->getID()); } if (isset($fields_array['severity']) && $this->selected_severity instanceof entities\Datatype) { $issue->setSeverity($this->selected_severity->getID()); } if (isset($fields_array['priority']) && $this->selected_priority instanceof entities\Datatype) { $issue->setPriority($this->selected_priority->getID()); } if (isset($fields_array['estimated_time'])) { $issue->setEstimatedTime($this->selected_estimated_time); } if (isset($fields_array['spent_time'])) { $issue->setSpentTime($this->selected_spent_time); } if (isset($fields_array['milestone']) || isset($this->selected_milestone)) { $issue->setMilestone($this->selected_milestone); } if (isset($fields_array['percent_complete'])) { $issue->setPercentCompleted($this->selected_percent_complete); } if (isset($fields_array['pain_bug_type'])) { $issue->setPainBugType($this->selected_pain_bug_type); } if (isset($fields_array['pain_likelihood'])) { $issue->setPainLikelihood($this->selected_pain_likelihood); } if (isset($fields_array['pain_effect'])) { $issue->setPainEffect($this->selected_pain_effect); } foreach (entities\CustomDatatype::getAll() as $customdatatype) { if (!isset($fields_array[$customdatatype->getKey()])) { continue; } if ($customdatatype->hasCustomOptions()) { if (isset($fields_array[$customdatatype->getKey()]) && $this->selected_customdatatype[$customdatatype->getKey()] instanceof entities\CustomDatatypeOption) { $selected_option = $this->selected_customdatatype[$customdatatype->getKey()]; $issue->setCustomField($customdatatype->getKey(), $selected_option->getID()); } } else { $issue->setCustomField($customdatatype->getKey(), $this->selected_customdatatype[$customdatatype->getKey()]); } } // FIXME: If we set the issue assignee during report issue, this needs to be set INSTEAD of this if ($this->selected_project->canAutoassign()) { if (isset($fields_array['component']) && $this->selected_component instanceof entities\Component && $this->selected_component->hasLeader()) { $issue->setAssignee($this->selected_component->getLeader()); } elseif (isset($fields_array['edition']) && $this->selected_edition instanceof entities\Edition && $this->selected_edition->hasLeader()) { $issue->setAssignee($this->selected_edition->getLeader()); } elseif ($this->selected_project->hasLeader()) { $issue->setAssignee($this->selected_project->getLeader()); } } $issue->save(); if (isset($this->parent_issue)) { $issue->addParentIssue($this->parent_issue); } if (isset($fields_array['edition']) && $this->selected_edition instanceof entities\Edition) { $issue->addAffectedEdition($this->selected_edition); } if (isset($fields_array['build']) && $this->selected_build instanceof entities\Build) { $issue->addAffectedBuild($this->selected_build); } if (isset($fields_array['component']) && $this->selected_component instanceof entities\Component) { $issue->addAffectedComponent($this->selected_component); } return $issue; }
public function componentResults_normal() { if (!property_exists($this, 'show_project')) { $this->show_project = false; } $this->default_columns = entities\SavedSearch::getDefaultVisibleColumns(); $this->custom_columns = entities\CustomDatatype::getAll(); $this->visible_columns = $this->search_object->getColumns(); $this->cc = isset($this->cc) ? $this->cc : 0; $this->actionable = isset($this->actionable) ? $this->actionable : true; $this->prevgroup_id = isset($this->prevgroup_id) ? $this->prevgroup_id : 0; }
public function componentIssueTypeSchemeOptions() { $this->issuetype = entities\Issuetype::getB2DBTable()->selectById($this->id); $this->scheme = entities\IssuetypeScheme::getB2DBTable()->selectById($this->scheme_id); $this->builtinfields = entities\Datatype::getAvailableFields(true); $this->customtypes = entities\CustomDatatype::getAll(); $this->visiblefields = $this->scheme->getVisibleFieldsForIssuetype($this->issuetype); }