Subversion Repositories php_library

Rev

Blame | Last modification | View Log | Download | RSS feed

<!-- 
     This code should be entered in your web page someplace. It will create
     a div and a button, then attach to the bugreport script
-->
<button name='bugreport' type='button' onclick="togglebugreport()">Bug Report</button>
<div class='bugreport' id='bugreport' style='display:none; background: white; border: 1px solid black; padding: 5px;'>
    <?php include_once("bugreport.php"); ?>
</div>
<script>
   var bugreport = document.getElementById("bugreport"),
   bugreportVisible = false;

   function togglebugreport() {
      if (bugreportVisible) {
         bugreport.style.cssText = "display: none; background: white; border: 1px solid black; padding: 5px; position: relative;";
      } else {
         bugreport.style.cssText = "display: inline-block; background: white; border: 1px solid black; padding: 5px; position: relative;";
      }
      bugreportVisible = !bugreportVisible;
   }
</script>

Also, we need this someplace in the code that calls it. I put it in an 
config file for the application
<?php
   // if the following is defined, will allow submission to a Redmine instance via e-mail
   $GLOBALS['bugReport'] = array( 
      // which e-mail account it should go to
      'mailto' => 'redmine@example.com',
      // name of redmine project, from URL
      'project' => 'timetracker',
      // version if it is used. Comment out for none
      'version' => '',
      // default reporter
      'reporter' => 'default@example.com',
      // possible components. Subject will be set from this
      'components' => array(
                          'Time Sheet',
                          'Personal Data',
                          'View Payroll',
                          'Create Payroll',
                          'Create Invoice',
                          'Reports'
                      ),
      // trackers available as defined in Redmine instance
      'tracker' => array( 
                     'Bug',
                     'Feature',
                     'Support'
             ),
      // Priorities defined in Redmine
      'priority' => array(
                    'Low',
                    'Normal',
                    'High',
                    'Urgent',
                    'Immediate'
             )
     );
?>