Subversion Repositories php_library

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
59 rodolico 1
<?php
2
   /* Modify the constants in the top; the rest of the page should work 
3
    * after that
4
    */
5
   /* these are constants */
6
   // e-mail address of OpenProject interface
7
   global $bugReport;
8
   $mailTo = $bugReport['mailto'];
9
   // this must contain the project name from OpenProject
10
   $project = $bugReport['project'];
11
   // list of components known by OpenProject
12
   $components = $bugReport['components'];
13
   // these must be trackers defined in your Redmine installation
14
   $tracker = $bugReport['tracker'];
15
   // and these are the priorities
16
   // Hint: you migh want to leave Urgent and Immediate not accessible
17
   $priority = $bugReport['priority'];
18
   /* 
19
    * this is the person reporting. They must be a valid login on 
20
    * your install unless you have anonymous users able to create
21
    * issues
22
    */
23
   $reporter = $bugReport['reporter'];
24
   // version number, if applicable
25
   $version = isset( $bugReport['version'] ) ? $bugReport['version'] : '';
26
   $summary = isset( $summary ) ? $summary : '';
27
   $from = isset( $from ) ? $from : '';
28
   $description = isset( $description ) ? $description : "Actions Taken\n==============\n\n" .
29
                  "n\nResults\n==============\n\n" . 
30
                  "n\nExpected Results\n==============\n\n";
31
 
32
   if ( isset( $_REQUEST['send'] ) ) {
33
      $component = $_REQUEST['component'];
34
      $summary = $_REQUEST['summary'];
35
      $message = 
36
         "Project: $project\n" . 
37
         "Tracker: $_REQUEST[tracker]\n" . 
38
         "Priority: $_REQUEST[priority]\n\n" . 
39
         "Reported by: $_REQUEST[from]\n" .
40
         $_REQUEST['description'];
41
      if ( ! isset( $reporter ) ) {
42
         $reporter = $_REQUEST['from'];
43
      }
44
 
45
      mail( $mailTo, "$_REQUEST[component]: $summary", $message, "From: $reporter" ); //array('From' => $reporter ) );
46
      $message = "Bug report submitted.";
47
   } else {
48
      $description = "Actions Taken\n==============\n\n" .
49
                  "n\nResults\n==============\n\n" . 
50
                  "n\nExpected Results\n==============\n\n";
51
   }
52
 
53
?>
54
 
55
      <b>Enter a bug report for</b> <br />
56
      <b><?php print $project; ?></b>
57
      <form method="post">
58
         <fieldset>
59
            <legend>Submit a Bug Report</legend>
60
            <div>
61
               <label for='component'>Component</label>
62
               <select name='component' required>
63
                  <?php
64
                     foreach ( $components as $component ) {
65
                        print "<option value='$component'>$component</option>";
66
                     }
67
                  ?>
68
               </select>
69
            </div>
70
            <div>
71
               <label for='tracker'>Request Type</label>
72
               <select name='tracker' required>
73
                  <?php
74
                     foreach ( $tracker as $trackers ) {
75
                        print "<option value='$trackers'>$trackers</option>";
76
                     }
77
                  ?>
78
               </select>
79
            </div>
80
            <div>
81
               <label for='priority'>Priority</label>
82
               <select name='priority' required>
83
                  <?php
84
                     foreach ( $priority as $priorities ) {
85
                        print "<option value='$priorities'>$priorities</option>";
86
                     }
87
                  ?>
88
               </select>
89
            </div>
90
 
91
            <div>
92
               <label for="summary">Summary</label>
93
               <input name='summary' type='text' <?php if ( $summary ) print "value='$summary'"; ?> required>
94
            </div>
95
            <div>
96
               <label for="from">Your E-Mail</label>
97
               <input name='from' type='email' <?php if ( $from ) print "value='$from'"; ?> required>
98
            </div>
99
 
100
            <div>
101
               <label for="description">Details</label>
102
               <textarea cols='50' rows='10' name='description' <?php if ( $description ) print "value='$description'"; ?> required></textarea>
103
            </div>
104
            <div>
105
               <input name='send' type='submit' value='Send'>
106
            </div>
107
 
108
         </fieldset>
109
      </form>
110