BugChange.pm 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # -*- Mode: perl; indent-tabs-mode: nil -*-
  2. #
  3. # The contents of this file are subject to the Mozilla Public
  4. # License Version 1.1 (the "License"); you may not use this file
  5. # except in compliance with the License. You may obtain a copy of
  6. # the License at http://www.mozilla.org/MPL/
  7. #
  8. # Software distributed under the License is distributed on an "AS
  9. # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  10. # implied. See the License for the specific language governing
  11. # rights and limitations under the License.
  12. #
  13. # The Original Code is the Bugzilla Bug Tracking System.
  14. #
  15. # The Initial Developer of the Original Code is Netscape Communications
  16. # Corporation. Portions created by Netscape are
  17. # Copyright (C) 1998 Netscape Communications Corporation. All
  18. # Rights Reserved.
  19. #
  20. # Contributor(s): Terry Weissman <terry@mozilla.org>
  21. # Dawn Endico <endico@mozilla.org>
  22. # Dan Mosedale <dmose@mozilla.org>
  23. # Joe Robins <jmrobins@tgix.com>
  24. # Jacob Steenhagen <jake@bugzilla.org>
  25. # J. Paul Reed <preed@sigkill.com>
  26. # Bradley Baetz <bbaetz@student.usyd.edu.au>
  27. # Joseph Heenan <joseph@heenan.me.uk>
  28. # Erik Stambaugh <erik@dasbistro.com>
  29. # Frédéric Buclin <LpSolit@gmail.com>
  30. #
  31. package Bugzilla::Config::BugChange;
  32. use strict;
  33. use Bugzilla::Config::Common;
  34. use Bugzilla::Status;
  35. $Bugzilla::Config::BugChange::sortkey = "03";
  36. sub get_param_list {
  37. my $class = shift;
  38. # Hardcoded bug statuses which existed before Bugzilla 3.1.
  39. my @closed_bug_statuses = ('RESOLVED', 'VERIFIED', 'CLOSED');
  40. # If we are upgrading from 3.0 or older, bug statuses are not customisable
  41. # and bug_status.is_open is not yet defined (hence the eval), so we use
  42. # the bug statuses above as they are still hardcoded.
  43. eval {
  44. my @current_closed_states = map {$_->name} closed_bug_statuses();
  45. # If no closed state was found, use the default list above.
  46. @closed_bug_statuses = @current_closed_states if scalar(@current_closed_states);
  47. };
  48. my @param_list = (
  49. {
  50. name => 'duplicate_or_move_bug_status',
  51. type => 's',
  52. choices => \@closed_bug_statuses,
  53. default => $closed_bug_statuses[0],
  54. checker => \&check_bug_status
  55. },
  56. {
  57. name => 'letsubmitterchoosepriority',
  58. type => 'b',
  59. default => 1
  60. },
  61. {
  62. name => 'letsubmitterchoosemilestone',
  63. type => 'b',
  64. default => 1
  65. },
  66. {
  67. name => 'musthavemilestoneonaccept',
  68. type => 'b',
  69. default => 0
  70. },
  71. {
  72. name => 'commentonclearresolution',
  73. type => 'b',
  74. default => 0
  75. },
  76. {
  77. name => 'commentonchange_resolution',
  78. type => 'b',
  79. default => 0
  80. },
  81. {
  82. name => 'commentonreassignbycomponent',
  83. type => 'b',
  84. default => 0
  85. },
  86. {
  87. name => 'commentonduplicate',
  88. type => 'b',
  89. default => 0
  90. },
  91. {
  92. name => 'noresolveonopenblockers',
  93. type => 'b',
  94. default => 0,
  95. } );
  96. return @param_list;
  97. }
  98. 1;