[3905] | 1 | #!/usr/bin/perl
|
---|
| 2 |
|
---|
[4073] | 3 | use usabcgi;
|
---|
| 4 |
|
---|
[3905] | 5 | print "Content-type:text/html\n\n";
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | print "<html><head><title>Greenstone Usability - Report Details</title>\n";
|
---|
| 9 | $ENV{HTTP_USER_AGENT}=~/([^\/]*)\/([0-9]+\.[0-9]+)/;
|
---|
| 10 | if(($1 ne "Netscape")||($2 > 4.77)){
|
---|
| 11 | print "<style type=\"text/css\">\n";
|
---|
| 12 | print "\th1 \{font-family: sans-serif; font-size: 20px}\n";
|
---|
[4073] | 13 | print "\th2 \{font-family: sans-serif; font-size: 14px; color: #009966\}\n";
|
---|
| 14 | print "\ttd.sans {font-family:sans-serif; width: 50%; vertical-align:top}\n";
|
---|
[3905] | 15 | print "</style>\n"
|
---|
| 16 | }
|
---|
| 17 | print "</head><body>\n";
|
---|
| 18 |
|
---|
[4073] | 19 | ($imageloc) = usabcgi::get_config_info("httpimg");
|
---|
| 20 | if(!($imageloc =~ "http")) {$imageloc="http://".$ENV{HTTP_HOST}.$imageloc;}
|
---|
| 21 |
|
---|
[3905] | 22 | print "<table width=\"100%\"><tr>\n<td><h1>Greenstone Usability - Report Details</h1></td>\n";
|
---|
| 23 | print "<td align=\"right\">";
|
---|
[3961] | 24 | if ($imageloc) { print "<img src=\"$imageloc\/usabbanner.gif\" alt=\"Greenstonekoru design\" title=\"Greenstone koru design\">"; }
|
---|
[3905] | 25 | print "</td>\n</tr></table>";
|
---|
| 26 |
|
---|
[3961] | 27 | if((!($ENV{QUERY_STRING}=~/\d/)) || ($ENV{QUERY_STRING}=~/\D/) ) {
|
---|
| 28 | print "<h2>Each report sent has an ID number. This page needs one of those numbers to work.</h2></body></html>";
|
---|
| 29 | die;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
[4073] | 32 | ($etcfileloc) = usabcgi::get_config_info("gsdlhome");
|
---|
| 33 | if(!($etcfileloc =~/\/$/)) {$etcfileloc.="/";}
|
---|
| 34 | $etcfileloc .= "etc/usability.txt";
|
---|
[3961] | 35 | open (FILEIN, $etcfileloc) or die "could not open usability.txt\n";
|
---|
| 36 | while(<FILEIN>){
|
---|
| 37 | $etcfile.=$_;
|
---|
| 38 | }
|
---|
[3905] | 39 | close(FILEIN);
|
---|
[3961] | 40 |
|
---|
| 41 | if(!($etcfile=~ /$ENV{QUERY_STRING}/)) {
|
---|
[4073] | 42 | print "<h2>Each report sent has an ID number. This program needs one of those ID numbers to work, and the ID number provided wans't found</h2></body></html>";
|
---|
[3961] | 43 | die;
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | #get the report for whjich details are to be viewed.
|
---|
[4073] | 47 | $etcfile=~/report-id := $ENV{QUERY_STRING}\&usabend\;\n/;
|
---|
| 48 | $report = $&;
|
---|
[3905] | 49 | $tmp=$';
|
---|
[4073] | 50 | $tmp=~/----------------------?/;
|
---|
[3905] | 51 | $report.=$`;
|
---|
[4073] | 52 | @pairs=split(/\&usabend\;\n/,$report);
|
---|
[3905] | 53 | foreach $pair (@pairs) {
|
---|
| 54 | ($name, $value)= split(/ := /,$pair);
|
---|
[4073] | 55 | #this adds html tags for breaks
|
---|
| 56 | $value =~ s/\n/\<br\>/g;
|
---|
[3905] | 57 | $reportvals{$name}=$value;
|
---|
| 58 | }
|
---|
| 59 |
|
---|
[3961] | 60 |
|
---|
| 61 |
|
---|
[4073] | 62 |
|
---|
[3905] | 63 | print "<p>Your automatically generated report ID number is: <b>$reportvals{\"report-id\"}</b>";
|
---|
| 64 | delete $reportvals{"report-id"};
|
---|
| 65 |
|
---|
| 66 | print "<h2>The following technical information was automatically collected about your problem:</h2>\n";
|
---|
| 67 | print "<table><width=\"100%\">\n";
|
---|
| 68 |
|
---|
[3961] | 69 | make_table_entry("The URL of the page where you were having problems","URL");
|
---|
| 70 | make_table_entry("Time you opened the usability report window","opentime");
|
---|
| 71 | make_table_entry("Time you sent the usability report","sendtime");
|
---|
| 72 | make_table_entry("Time the report was received by the server","time");
|
---|
| 73 | make_table_entry("Your browser as it identifies itself","browser");
|
---|
| 74 | make_table_entry("Your browser as the server identifies it","browser-read-by-server");
|
---|
| 75 | make_table_entry("Your browser's IP number","browser-ip-no");
|
---|
| 76 | make_table_entry("The server's IP number","server-ip-no");
|
---|
| 77 | make_table_entry("Your language as recorded by your browser","language");
|
---|
| 78 | make_table_entry("The resolution of your screen","resolution");
|
---|
| 79 | make_table_entry("The colour of your screen","screencolour");
|
---|
| 80 | make_table_entry("The number of bits per pixel your display uses to represent colour","pixeldepth");
|
---|
[3905] | 81 | print"</table>";
|
---|
| 82 |
|
---|
[3961] | 83 | print "<h2>You provided us with the following extra information about the problem</h2>\n";
|
---|
[3905] | 84 |
|
---|
| 85 | print"<table>\n";
|
---|
[3961] | 86 | make_table_entry("How bad the problem was","severity");
|
---|
| 87 | make_table_entry("What kind of problem it was","probtype");
|
---|
| 88 | make_table_entry("Other details","moredetails");
|
---|
| 89 | print "</table>\n";
|
---|
[3905] | 90 |
|
---|
| 91 | print "<h2>The following data was automatically collected from the form on the greenstone interface</h2>\n";
|
---|
| 92 |
|
---|
| 93 | print"<table>\n";
|
---|
| 94 | print "<tr><td class=\"sans\"><b>Type of input</b></td><td class=\"sans\"><b>Name of input</b></td><td class=\"sans\"><b>Value of input</b></td></tr>\n";
|
---|
| 95 |
|
---|
| 96 | foreach $key (keys(%reportvals)){
|
---|
| 97 | $key=~/-/;
|
---|
| 98 | print "<tr><td>$`</td><td>$'</td><td>$reportvals{$key}</td></tr>\n";
|
---|
| 99 | }
|
---|
| 100 | print "</table>\n";
|
---|
| 101 |
|
---|
| 102 | print "</body></html>";
|
---|
| 103 |
|
---|
[3961] | 104 | #This function takes a key into the report values interface, and a desription
|
---|
| 105 | # of what that entry means, and makes a properly formatted html table entry
|
---|
| 106 | sub make_table_entry {
|
---|
| 107 | local ($desc, $entry) = @_;
|
---|
| 108 | print "<tr><td class=\"sans\" width=\"50%\"><b>$desc:</b></td>";
|
---|
| 109 | print "<td>$reportvals{$entry}</td></tr>\n";
|
---|
| 110 | delete $reportvals{$entry};
|
---|
[4073] | 111 |
|
---|
[3961] | 112 | }
|
---|
[3905] | 113 |
|
---|
| 114 |
|
---|
| 115 |
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 |
|
---|
| 119 |
|
---|
| 120 |
|
---|
| 121 |
|
---|
| 122 |
|
---|
| 123 |
|
---|
| 124 |
|
---|
[3961] | 125 |
|
---|