bugbuild.php 5.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. $this->app->loadLang('bug');
  3. $this->app->loadLang('product');
  4. $this->app->loadLang('testtask');
  5. $this->app->loadLang('build');
  6. $this->app->loadLang('execution');
  7. $this->app->loadLang('project');
  8. $this->app->loadLang('tree');
  9. $this->app->loadLang('dataview');
  10. $schema = new stdclass();
  11. $schema->primaryTable = 'bug';
  12. $schema->tables = array();
  13. $schema->tables['bug'] = 'zt_bug';
  14. $schema->tables['product'] = 'zt_product';
  15. $schema->tables['testtask'] = 'zt_testtask';
  16. $schema->tables['testcase'] = 'zt_case';
  17. $schema->tables['build'] = 'zt_build';
  18. $schema->tables['execution'] = 'zt_project';
  19. $schema->tables['project'] = 'zt_project';
  20. $schema->tables['module'] = 'zt_module';
  21. $schema->tables['casemodule'] = 'zt_module';
  22. $schema->joins = array();
  23. $schema->joins['product'] = '`product`.`id` = `bug`.`product`';
  24. $schema->joins['testtask'] = '`testtask`.`id` = `bug`.`testtask`';
  25. $schema->joins['build'] = '`build`.`id` = CAST(`testtask`.`build` AS DECIMAL)';
  26. $schema->joins['execution'] = '`execution`.`id` = `build`.`execution`';
  27. $schema->joins['project'] = '`project`.`id` = `build`.`project`';
  28. $schema->joins['module'] = '`module`.`id` = `bug`.`module`';
  29. $schema->joins['testcase'] = '`testcase`.`id` = `bug`.`case`';
  30. $schema->joins['casemodule'] = '`casemodule`.`id` = `testcase`.`module`';
  31. $schema->fields = array();
  32. $schema->fields['id'] = array('type' => 'number', 'name' => $this->lang->bug->id);
  33. $schema->fields['title'] = array('type' => 'string', 'name' => $this->lang->bug->title);
  34. $schema->fields['steps'] = array('type' => 'text', 'name' => $this->lang->bug->steps);
  35. $schema->fields['status'] = array('type' => 'option', 'name' => $this->lang->bug->status, 'options' => $this->lang->bug->statusList);
  36. $schema->fields['confirmed'] = array('type' => 'option', 'name' => $this->lang->bug->confirmed, 'options' => $this->lang->bug->confirmedList);
  37. $schema->fields['severity'] = array('type' => 'option', 'name' => $this->lang->bug->severity, 'options' => $this->lang->bug->severityList);
  38. $schema->fields['product'] = array('type' => 'object', 'name' => $this->lang->bug->product, 'object' => 'product', 'show' => 'product.name');
  39. $schema->fields['project'] = array('type' => 'object', 'name' => $this->lang->bug->project, 'object' => 'project', 'show' => 'project.name');
  40. $schema->fields['build'] = array('type' => 'object', 'name' => $this->lang->build->common, 'object' => 'build', 'show' => 'build.name');
  41. $schema->fields['module'] = array('type' => 'object', 'name' => $this->lang->bug->module, 'object' => 'module', 'show' => 'module.name');
  42. $schema->fields['testtask'] = array('type' => 'object', 'name' => $this->lang->testtask->common, 'object' => 'testtask', 'show' => 'testtask.name');
  43. $schema->fields['pri'] = array('type' => 'option', 'name' => $this->lang->bug->pri, 'options' => $this->lang->bug->priList);
  44. $schema->fields['openedBy'] = array('type' => 'user', 'name' => $this->lang->bug->openedBy);
  45. $schema->fields['openedDate'] = array('type' => 'datetime', 'name' => $this->lang->bug->openedDate);
  46. $schema->fields['resolvedBy'] = array('type' => 'user', 'name' => $this->lang->bug->resolvedBy);
  47. $schema->fields['resolution'] = array('type' => 'option', 'name' => $this->lang->bug->resolution, 'options' => $this->lang->bug->resolutionList);
  48. $schema->fields['resolvedDate'] = array('type' => 'datetime', 'name' => $this->lang->bug->resolvedDate);
  49. $schema->fields['casemodule'] = array('type' => 'object', 'name' => $this->lang->tree->module, 'object' => 'casemodule', 'show' => 'casemodule.name');
  50. $schema->objects = array();
  51. $schema->objects['product'] = array();
  52. $schema->objects['product']['id'] = array('type' => 'number', 'name' => $this->lang->product->id);
  53. $schema->objects['product']['name'] = array('type' => 'string', 'name' => $this->lang->product->common);
  54. $schema->objects['testtask'] = array();
  55. $schema->objects['testtask']['id'] = array('type' => 'number', 'name' => $this->lang->testtask->id);
  56. $schema->objects['testtask']['name'] = array('type' => 'string', 'name' => $this->lang->testtask->common);
  57. $schema->objects['build'] = array();
  58. $schema->objects['build']['id'] = array('type' => 'number', 'name' => $this->lang->build->id);
  59. $schema->objects['build']['name'] = array('type' => 'string', 'name' => $this->lang->build->common);
  60. $schema->objects['execution'] = array();
  61. $schema->objects['execution']['id'] = array('type' => 'number', 'name' => $this->lang->dataview->id);
  62. $schema->objects['execution']['name'] = array('type' => 'string', 'name' => $this->lang->execution->common);
  63. $schema->objects['project'] = array();
  64. $schema->objects['project']['id'] = array('type' => 'number', 'name' => $this->lang->project->id);
  65. $schema->objects['project']['name'] = array('type' => 'string', 'name' => $this->lang->project->common);
  66. $schema->objects['build'] = array();
  67. $schema->objects['build']['id'] = array('type' => 'number', 'name' => $this->lang->build->id);
  68. $schema->objects['build']['name'] = array('type' => 'string', 'name' => $this->lang->build->common);
  69. $schema->objects['module'] = array();
  70. $schema->objects['module']['id'] = array('type' => 'number', 'name' => $this->lang->dataview->id);
  71. $schema->objects['module']['name'] = array('type' => 'string', 'name' => $this->lang->tree->module);
  72. $schema->objects['testcase'] = array();
  73. $schema->objects['testcase']['id'] = array('type' => 'number', 'name' => $this->lang->dataview->id);
  74. $schema->objects['testcase']['title'] = array('type' => 'string', 'name' => $this->lang->testcase->common);
  75. $schema->objects['casemodule'] = array();
  76. $schema->objects['casemodule']['id'] = array('type' => 'number', 'name' => $this->lang->dataview->id);
  77. $schema->objects['casemodule']['name'] = array('type' => 'string', 'name' => $this->lang->dataview->name);