当前位置: 首页>>代码示例>>PHP>>正文


PHP Status::getAll方法代码示例

本文整理汇总了PHP中thebuggenie\core\entities\Status::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Status::getAll方法的具体用法?PHP Status::getAll怎么用?PHP Status::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thebuggenie\core\entities\Status的用法示例。


在下文中一共展示了Status::getAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: componentBoardColumnheader

 public function componentBoardColumnheader()
 {
     $this->statuses = \thebuggenie\core\entities\Status::getAll();
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:4,代码来源:Components.php

示例2: __

        echo __('Connected status');
        ?>
</label></dt>
                                    <dd>
                                        <select name="status_id" id="step_status">
                                            <option value="0"<?php 
        if (!$step->hasLinkedStatus()) {
            echo " selected";
        }
        ?>
><?php 
        echo __('Not connected to a status');
        ?>
</option>
                                            <?php 
        foreach (\thebuggenie\core\entities\Status::getAll() as $status) {
            ?>
                                            <option value="<?php 
            echo $status->getID();
            ?>
"<?php 
            if ($step->hasLinkedStatus() && $step->getLinkedStatus()->getID() == $status->getID()) {
                echo " selected";
            }
            ?>
><?php 
            echo $status->getName();
            ?>
</option>
                                            <?php 
        }
开发者ID:founderio,项目名称:thebuggenie,代码行数:31,代码来源:configureworkflowstep.html.php

示例3: getAvailableValues

 public function getAvailableValues()
 {
     switch ($this->getFilterKey()) {
         case 'issuetype':
             return framework\Context::isProjectContext() ? framework\Context::getCurrentProject()->getIssuetypeScheme()->getIssuetypes() : Issuetype::getAll();
         case 'status':
             return Status::getAll();
         case 'category':
             return Category::getAll();
         case 'priority':
             return Priority::getAll();
         case 'severity':
             return Severity::getAll();
         case 'reproducability':
             return Reproducability::getAll();
         case 'resolution':
             return Resolution::getAll();
         case 'project_id':
             return \thebuggenie\core\entities\Project::getAll();
         case 'build':
             return $this->_getAvailableBuildChoices();
         case 'component':
             return $this->_getAvailableComponentChoices();
         case 'edition':
             return $this->_getAvailableEditionChoices();
         case 'milestone':
             return $this->_getAvailableMilestoneChoices();
         case 'subprojects':
             $filters = array();
             $projects = Project::getIncludingAllSubprojectsAsArray(framework\Context::getCurrentProject());
             foreach ($projects as $project) {
                 if ($project->getID() == framework\Context::getCurrentProject()->getID()) {
                     continue;
                 }
                 $filters[$project->getID()] = $project;
             }
             return $filters;
         case 'owner_user':
         case 'assignee_user':
         case 'posted_by':
             return $this->_getAvailableUserChoices();
         case 'owner_team':
         case 'assignee_team':
             return $this->_getAvailableTeamChoices();
         default:
             $customdatatype = CustomDatatype::getByKey($this->getFilterKey());
             if ($customdatatype instanceof \thebuggenie\core\entities\CustomDatatype && $customdatatype->hasCustomOptions()) {
                 return $customdatatype->getOptions();
             } else {
                 switch ($this->getFilterType()) {
                     case CustomDatatype::COMPONENTS_CHOICE:
                         return $this->_getAvailableComponentChoices();
                     case CustomDatatype::RELEASES_CHOICE:
                         return $this->_getAvailableBuildChoices();
                     case CustomDatatype::EDITIONS_CHOICE:
                         return $this->_getAvailableEditionChoices();
                     case CustomDatatype::MILESTONE_CHOICE:
                         return $this->_getAvailableMilestoneChoices();
                     case CustomDatatype::USER_CHOICE:
                         return $this->_getAvailableUserChoices();
                     case CustomDatatype::TEAM_CHOICE:
                         return $this->_getAvailableTeamChoices();
                     case CustomDatatype::CLIENT_CHOICE:
                         return $this->_getAvailableClientChoices();
                     case CustomDatatype::STATUS_CHOICE:
                         return Status::getAll();
                     default:
                         return array();
                 }
             }
     }
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:72,代码来源:SearchFilter.php

示例4: _populateStatusCount

 protected function _populateStatusCount()
 {
     if ($this->_statuscount === null) {
         $this->_statuscount = array();
         $this->_statuscount[0] = array('open' => 0, 'closed' => 0, 'percentage' => 0);
         foreach (Status::getAll() as $status_id => $status) {
             $this->_statuscount[$status_id] = array('open' => 0, 'closed' => 0, 'percentage' => 0);
         }
         foreach (tables\Issues::getTable()->getStatusCountByProjectID($this->getID()) as $status_id => $status_count) {
             $this->_statuscount[$status_id] = $status_count;
         }
     }
 }
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:13,代码来源:Project.php

示例5: _populateOptions

 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;
             }
         }
     }
 }
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:26,代码来源:CustomDatatype.php

示例6: __

                         <?php 
     echo __('Assign issue to %user', array('%user' => ''));
     ?>
                     <?php 
 } elseif ($action->isCustomSetAction()) {
     ?>
                         <?php 
     echo __('Set issue field %key to %value', array('%key' => $action->getCustomActionType(), '%value' => ''));
     ?>
                     <?php 
 }
 ?>
                 </label>
                 <?php 
 if ($action->getActionType() == \thebuggenie\core\entities\WorkflowTransitionAction::ACTION_SET_STATUS) {
     $options = \thebuggenie\core\entities\Status::getAll();
 } elseif ($action->getActionType() == \thebuggenie\core\entities\WorkflowTransitionAction::ACTION_SET_PRIORITY) {
     $options = \thebuggenie\core\entities\Priority::getAll();
 } elseif ($action->getActionType() == \thebuggenie\core\entities\WorkflowTransitionAction::ACTION_SET_PERCENT) {
     $options = range(1, 100);
 } elseif ($action->getActionType() == \thebuggenie\core\entities\WorkflowTransitionAction::ACTION_SET_RESOLUTION) {
     $options = \thebuggenie\core\entities\Resolution::getAll();
 } elseif ($action->getActionType() == \thebuggenie\core\entities\WorkflowTransitionAction::ACTION_SET_REPRODUCABILITY) {
     $options = \thebuggenie\core\entities\Reproducability::getAll();
 } elseif ($action->isCustomAction()) {
     $customfield = \thebuggenie\core\entities\CustomDatatype::getByKey($action->getCustomActionType());
     if ($customfield->getType() == \thebuggenie\core\entities\CustomDatatype::CALCULATED_FIELD) {
         $options = array();
     } else {
         $options = $customfield->getOptions();
     }
开发者ID:founderio,项目名称:thebuggenie,代码行数:31,代码来源:_workflowtransitionaction.inc.php

示例7: foreach

                }
                ?>
                                            </select>
                                            <?php 
                break;
            case \thebuggenie\core\entities\CustomDatatype::STATUS_CHOICE:
                ?>
                                            <select name="<?php 
                echo $customdatatype->getKey();
                ?>
_id" id="<?php 
                echo $customdatatype->getKey();
                ?>
_id_additional">
                                                <?php 
                foreach (\thebuggenie\core\entities\Status::getAll() as $option) {
                    ?>
                                                <option value="<?php 
                    echo $option->getID();
                    ?>
"<?php 
                    if ($selected_customdatatype[$customdatatype->getKey()] == $option->getID()) {
                        ?>
 selected<?php 
                    }
                    ?>
><?php 
                    echo $option->getName();
                    ?>
</option>
                                                <?php 
开发者ID:JonathanRH,项目名称:thebuggenie,代码行数:31,代码来源:_reportissue.inc.php

示例8: getRuleOptions

 public function getRuleOptions()
 {
     if ($this->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_STATUS_VALID) {
         $options = \thebuggenie\core\entities\Status::getAll();
     } elseif ($this->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_PRIORITY_VALID) {
         $options = \thebuggenie\core\entities\Priority::getAll();
     } elseif ($this->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_RESOLUTION_VALID) {
         $options = \thebuggenie\core\entities\Resolution::getAll();
     } elseif ($this->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_REPRODUCABILITY_VALID) {
         $options = \thebuggenie\core\entities\Reproducability::getAll();
     } elseif ($this->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_TEAM_MEMBERSHIP_VALID) {
         $options = \thebuggenie\core\entities\Team::getAll();
     } elseif ($this->getRule() == \thebuggenie\core\entities\WorkflowTransitionValidationRule::RULE_ISSUE_IN_MILESTONE_VALID) {
         $options = \thebuggenie\core\entities\Milestone::getB2DBTable()->selectAll();
     } elseif ($this->isCustom()) {
         $options = $this->getCustomField()->getOptions();
     }
     return $options;
 }
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:19,代码来源:WorkflowTransitionValidationRule.php

示例9: componentFilter

 public function componentFilter()
 {
     $pkey = framework\Context::isProjectContext() ? framework\Context::getCurrentProject()->getID() : null;
     $i18n = framework\Context::getI18n();
     $this->selected_operator = isset($this->selected_operator) ? $this->selected_operator : '=';
     $this->key = isset($this->key) ? $this->key : null;
     $this->filter = isset($this->filter) ? $this->filter : null;
     if (in_array($this->filter, array('posted', 'last_updated'))) {
         $this->selected_value = $this->selected_value ? $this->selected_value : NOW;
     } else {
         $this->selected_value = isset($this->selected_value) ? $this->selected_value : 0;
     }
     $this->filter_info = isset($this->filter_info) ? $this->filter_info : null;
     $filters = array();
     $filters['status'] = array('description' => $i18n->__('Status'), 'options' => entities\Status::getAll());
     $filters['category'] = array('description' => $i18n->__('Category'), 'options' => entities\Category::getAll());
     $filters['priority'] = array('description' => $i18n->__('Priority'), 'options' => entities\Priority::getAll());
     $filters['severity'] = array('description' => $i18n->__('Severity'), 'options' => entities\Severity::getAll());
     $filters['reproducability'] = array('description' => $i18n->__('Reproducability'), 'options' => entities\Reproducability::getAll());
     $filters['resolution'] = array('description' => $i18n->__('Resolution'), 'options' => entities\Resolution::getAll());
     $filters['issuetype'] = array('description' => $i18n->__('Issue type'), 'options' => entities\Issuetype::getAll());
     $filters['component'] = array('description' => $i18n->__('Component'), 'options' => array());
     $filters['build'] = array('description' => $i18n->__('Build'), 'options' => array());
     $filters['edition'] = array('description' => $i18n->__('Edition'), 'options' => array());
     $filters['milestone'] = array('description' => $i18n->__('Milestone'), 'options' => array());
     if (framework\Context::isProjectContext()) {
         $filters['subprojects'] = array('description' => $i18n->__('Include subproject(s)'), 'options' => array('all' => $this->getI18n()->__('All subprojects'), 'none' => $this->getI18n()->__("Don't include subprojects (default, unless specified otherwise)")));
         $projects = entities\Project::getIncludingAllSubprojectsAsArray(framework\Context::getCurrentProject());
         foreach ($projects as $project) {
             if ($project->getID() == framework\Context::getCurrentProject()->getID()) {
                 continue;
             }
             $filters['subprojects']['options'][$project->getID()] = "{$project->getName()} ({$project->getKey()})";
         }
     } else {
         $projects = array();
         foreach (entities\Project::getAllRootProjects() as $project) {
             entities\Project::getSubprojectsArray($project, $projects);
         }
     }
     if (count($projects) > 0) {
         foreach ($projects as $project) {
             foreach ($project->getComponents() as $component) {
                 $filters['component']['options'][] = $component;
             }
             foreach ($project->getBuilds() as $build) {
                 $filters['build']['options'][] = $build;
             }
             foreach ($project->getEditions() as $edition) {
                 $filters['edition']['options'][] = $edition;
             }
             foreach ($project->getMilestones() as $milestone) {
                 $filters['milestone']['options'][] = $milestone;
             }
         }
     }
     $filters['posted_by'] = array('description' => $i18n->__('Posted by'));
     $filters['assignee_user'] = array('description' => $i18n->__('Assigned to user'));
     $filters['assignee_team'] = array('description' => $i18n->__('Assigned to team'));
     $filters['owner_user'] = array('description' => $i18n->__('Owned by user'));
     $filters['owner_team'] = array('description' => $i18n->__('Owned by team'));
     $filters['posted'] = array('description' => $i18n->__('Date reported'));
     $filters['last_updated'] = array('description' => $i18n->__('Date last updated'));
     $this->filters = $filters;
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:65,代码来源:Components.php

示例10: _setupReportIssueProperties

 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();
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:37,代码来源:Components.php

示例11: getAvailableStatuses

 /**
  * Get current available statuses
  *
  * @return array|\thebuggenie\core\entities\Status
  */
 public function getAvailableStatuses()
 {
     $statuses = array();
     $available_statuses = Status::getAll();
     foreach ($this->getAvailableWorkflowTransitions() as $transition) {
         if ($transition->getOutgoingStep()->hasLinkedStatus()) {
             if ($status = $transition->getOutgoingStep()->getLinkedStatus()) {
                 $statuses[$status->getID()] = $status;
             }
         } elseif ($transition->hasPostValidationRule(WorkflowTransitionValidationRule::RULE_STATUS_VALID)) {
             $values = explode(',', $transition->getPostValidationRule(WorkflowTransitionValidationRule::RULE_STATUS_VALID)->getRuleValue());
             foreach ($values as $value) {
                 if (array_key_exists($value, $available_statuses)) {
                     $statuses[$value] = $available_statuses[$value];
                 }
             }
         }
     }
     return $statuses;
 }
开发者ID:AzerothShard,项目名称:thebuggenie,代码行数:25,代码来源:Issue.php

示例12: componentProjectSettings

 public function componentProjectSettings()
 {
     $this->statustypes = entities\Status::getAll();
 }
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:4,代码来源:Components.php

示例13: __

                        ?>
"<?php 
                        if ($issue instanceof \thebuggenie\core\entities\Issue && $issue->getCustomField($field) instanceof \thebuggenie\core\entities\Milestone && $issue->getCustomField($field)->getID() == $choice->getID()) {
                            ?>
 selected<?php 
                        }
                        ?>
><?php 
                        echo __($choice->getName());
                        ?>
</option>
                                                <?php 
                    }
                    break;
                case \thebuggenie\core\entities\CustomDatatype::STATUS_CHOICE:
                    foreach (\thebuggenie\core\entities\Status::getAll() as $choice) {
                        ?>
                                                    <option value="<?php 
                        echo $choice->getID();
                        ?>
"<?php 
                        if ($issue instanceof \thebuggenie\core\entities\Issue && $issue->getCustomField($field) instanceof \thebuggenie\core\entities\Edition && $issue->getCustomField($field)->getID() == $choice->getID()) {
                            ?>
 selected<?php 
                        }
                        ?>
><?php 
                        echo __($choice->getName());
                        ?>
</option>
                                                <?php 
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:31,代码来源:_updateissueproperties.inc.php

示例14: runAddAffected

 public function runAddAffected(framework\Request $request)
 {
     framework\Context::loadLibrary('ui');
     try {
         $issue = entities\Issue::getB2DBTable()->selectById($request['issue_id']);
         $statuses = entities\Status::getAll();
         switch ($request['item_type']) {
             case 'edition':
                 if (!$issue->getProject()->isEditionsEnabled()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('Editions are disabled')));
                 } elseif (!$issue->canEditAffectedEditions()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('You are not allowed to do this')));
                 }
                 $edition = entities\Edition::getB2DBTable()->selectById($request['which_item_edition']);
                 if (tables\IssueAffectsEdition::getTable()->getByIssueIDandEditionID($issue->getID(), $edition->getID())) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('%item is already affected by this issue', array('%item' => $edition->getName()))));
                 }
                 $result = $issue->addAffectedEdition($edition);
                 if ($result !== false) {
                     $itemtype = 'edition';
                     $item = $result;
                     $itemtypename = framework\Context::getI18n()->__('Edition');
                     $content = get_component_html('main/affecteditem', array('item' => $item, 'itemtype' => $itemtype, 'itemtypename' => $itemtypename, 'issue' => $issue, 'statuses' => $statuses));
                 }
                 $message = framework\Context::getI18n()->__('Edition <b>%edition</b> is now affected by this issue', array('%edition' => $edition->getName()), true);
                 break;
             case 'component':
                 if (!$issue->getProject()->isComponentsEnabled()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('Components are disabled')));
                 } elseif (!$issue->canEditAffectedComponents()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('You are not allowed to do this')));
                 }
                 $component = entities\Component::getB2DBTable()->selectById($request['which_item_component']);
                 if (tables\IssueAffectsComponent::getTable()->getByIssueIDandComponentID($issue->getID(), $component->getID())) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('%item is already affected by this issue', array('%item' => $component->getName()))));
                 }
                 $result = $issue->addAffectedComponent($component);
                 if ($result !== false) {
                     $itemtype = 'component';
                     $item = $result;
                     $itemtypename = framework\Context::getI18n()->__('Component');
                     $content = get_component_html('main/affecteditem', array('item' => $item, 'itemtype' => $itemtype, 'itemtypename' => $itemtypename, 'issue' => $issue, 'statuses' => $statuses));
                 }
                 $message = framework\Context::getI18n()->__('Component <b>%component</b> is now affected by this issue', array('%component' => $component->getName()), true);
                 break;
             case 'build':
                 if (!$issue->getProject()->isBuildsEnabled()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('Releases are disabled')));
                 } elseif (!$issue->canEditAffectedBuilds()) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('You are not allowed to do this')));
                 }
                 $build = entities\Build::getB2DBTable()->selectById($request['which_item_build']);
                 if (tables\IssueAffectsBuild::getTable()->getByIssueIDandBuildID($issue->getID(), $build->getID())) {
                     $this->getResponse()->setHttpStatus(400);
                     return $this->renderJSON(array('error' => framework\Context::getI18n()->__('%item is already affected by this issue', array('%item' => $build->getName()))));
                 }
                 $result = $issue->addAffectedBuild($build);
                 if ($result !== false) {
                     $itemtype = 'build';
                     $item = $result;
                     $itemtypename = framework\Context::getI18n()->__('Release');
                     $content = get_component_html('main/affecteditem', array('item' => $item, 'itemtype' => $itemtype, 'itemtypename' => $itemtypename, 'issue' => $issue, 'statuses' => $statuses));
                 }
                 $message = framework\Context::getI18n()->__('Release <b>%build</b> is now affected by this issue', array('%build' => $build->getName()), true);
                 break;
             default:
                 throw new \Exception('Internal error');
         }
         $editions = array();
         $components = array();
         $builds = array();
         if ($issue->getProject()->isEditionsEnabled()) {
             $editions = $issue->getEditions();
         }
         if ($issue->getProject()->isComponentsEnabled()) {
             $components = $issue->getComponents();
         }
         if ($issue->getProject()->isBuildsEnabled()) {
             $builds = $issue->getBuilds();
         }
         $count = count($editions) + count($components) + count($builds);
         return $this->renderJSON(array('content' => $content, 'message' => $message, 'itemcount' => $count));
     } catch (\Exception $e) {
         $this->getResponse()->setHttpStatus(400);
         return $this->renderJSON(array('error' => $e->getMessage()));
     }
 }
开发者ID:nrensen,项目名称:thebuggenie,代码行数:95,代码来源:Main.php

示例15: runIndex

 /**
  * Configuration import page
  *
  * @param framework\Request $request
  */
 public function runIndex(framework\Request $request)
 {
     if ($request->isPost()) {
         if ($request['import_sample_data']) {
             $transaction = \b2db\Core::startTransaction();
             $users = array();
             $user1 = new entities\User();
             $user1->setUsername('john');
             $user1->setPassword('john');
             $user1->setBuddyname('John');
             $user1->setRealname('John');
             $user1->setActivated();
             $user1->setEnabled();
             $user1->save();
             $users[] = $user1;
             $user2 = new entities\User();
             $user2->setUsername('jane');
             $user2->setPassword('jane');
             $user2->setBuddyname('Jane');
             $user2->setRealname('Jane');
             $user2->setActivated();
             $user2->setEnabled();
             $user2->save();
             $users[] = $user2;
             $user3 = new entities\User();
             $user3->setUsername('jackdaniels');
             $user3->setPassword('jackdaniels');
             $user3->setBuddyname('Jack');
             $user3->setRealname('Jack Daniels');
             $user3->setActivated();
             $user3->setEnabled();
             $user3->save();
             $users[] = $user3;
             $project1 = new entities\Project();
             $project1->setName('Sample project 1');
             $project1->setOwner($users[rand(0, 2)]);
             $project1->setLeader($users[rand(0, 2)]);
             $project1->setQaResponsible($users[rand(0, 2)]);
             $project1->setDescription('This is a sample project that is awesome. Try it out!');
             $project1->setHomepage('http://www.google.com');
             $project1->save();
             $project2 = new entities\Project();
             $project2->setName('Sample project 2');
             $project2->setOwner($users[rand(0, 2)]);
             $project2->setLeader($users[rand(0, 2)]);
             $project2->setQaResponsible($users[rand(0, 2)]);
             $project2->setDescription('This is the second sample project. Not as awesome as the first one, but still worth a try!');
             $project2->setHomepage('http://www.bing.com');
             $project2->save();
             foreach (array($project1, $project2) as $project) {
                 for ($cc = 1; $cc <= 5; $cc++) {
                     $milestone = new entities\Milestone();
                     $milestone->setName("Milestone {$cc}");
                     $milestone->setProject($project);
                     $milestone->setType(entities\Milestone::TYPE_REGULAR);
                     if ((bool) rand(0, 1)) {
                         $milestone->setScheduledDate(NOW + 100000 * (20 * $cc));
                     }
                     $milestone->save();
                 }
             }
             $p1_milestones = $project1->getMilestones();
             $p2_milestones = $project2->getMilestones();
             $issues = array();
             $priorities = entities\Priority::getAll();
             $categories = entities\Category::getAll();
             $severities = entities\Severity::getAll();
             $statuses = entities\Status::getAll();
             $reproducabilities = entities\Reproducability::getAll();
             $lorem_ipsum = \thebuggenie\modules\publish\entities\tables\Articles::getTable()->getArticleByName('LoremIpsum');
             $lorem_words = explode(' ', $lorem_ipsum->getContent());
             foreach (array('bugreport', 'featurerequest', 'enhancement', 'idea') as $issuetype) {
                 $issuetype = entities\Issuetype::getByKeyish($issuetype);
                 for ($cc = 1; $cc <= 10; $cc++) {
                     $issue1 = new entities\Issue();
                     $issue1->setProject($project1);
                     $issue1->setPostedBy($users[rand(0, 2)]);
                     $issue1->setPosted(NOW - 86400 * rand(1, 30));
                     $title_string = '';
                     $description_string = '';
                     $rand_length = rand(4, 15);
                     $ucnext = true;
                     for ($ll = 1; $ll <= $rand_length; $ll++) {
                         $word = str_replace(array(',', '.', "\r", "\n"), array('', '', '', ''), $lorem_words[array_rand($lorem_words)]);
                         $word = $ucnext || rand(1, 40) == 19 ? ucfirst($word) : mb_strtolower($word);
                         $title_string .= $word;
                         $ucnext = false;
                         if ($ll == $rand_length || rand(1, 15) == 5) {
                             $title_string .= '.';
                             $ucnext = true;
                         }
                         $title_string .= ' ';
                     }
                     $rand_length = rand(40, 500);
                     $ucnext = true;
//.........这里部分代码省略.........
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:101,代码来源:Main.php


注:本文中的thebuggenie\core\entities\Status::getAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。