1 | #!/usr/bin/perl
|
---|
2 |
|
---|
3 | use usabcgi;
|
---|
4 |
|
---|
5 | print "Content-type:text/html\n\n";
|
---|
6 |
|
---|
7 |
|
---|
8 | print "<html><head><title>Greenstone Usability - Report Details</title>\n";
|
---|
9 | usabcgi::printscript;
|
---|
10 | usabcgi::printstyle($ENV{HTTP_USER_AGENT});
|
---|
11 |
|
---|
12 | print "</head><body bgcolor=\"#ffffff\">\n";
|
---|
13 |
|
---|
14 | ($imageloc) = usabcgi::get_config_info("httpimg");
|
---|
15 | if(!($imageloc =~ "http")) {$imageloc="http://".$ENV{HTTP_HOST}.$imageloc;}
|
---|
16 |
|
---|
17 | print "<table width=\"100%\"><tr>\n<td><h1>Greenstone Usability - Report Details</h1></td>\n";
|
---|
18 | print "<td align=\"right\">";
|
---|
19 | if ($imageloc) { print "<img src=\"$imageloc\/usabbanner.gif\" alt=\"Greenstonekoru design\" title=\"Greenstone koru design\">"; }
|
---|
20 | print "</td>\n</tr></table>";
|
---|
21 | usabcgi::printaplinks;
|
---|
22 |
|
---|
23 | if((!($ENV{QUERY_STRING}=~/\d/)) || ($ENV{QUERY_STRING}=~/\D/) ) {
|
---|
24 | print "<h2>Each report sent has an ID number. This page needs one of those numbers to work.</h2></body></html>";
|
---|
25 | die;
|
---|
26 | }
|
---|
27 |
|
---|
28 | ($etcfileloc) = usabcgi::get_config_info("gsdlhome");
|
---|
29 | if(!($etcfileloc =~/\/$/)) {$etcfileloc.="/";}
|
---|
30 | $etcfileloc .= "etc/usability.txt";
|
---|
31 | open (FILEIN, $etcfileloc) or die "could not open usability.txt\n";
|
---|
32 | while(<FILEIN>){
|
---|
33 | $etcfile.=$_;
|
---|
34 | }
|
---|
35 | close(FILEIN);
|
---|
36 |
|
---|
37 | if(!($etcfile=~ /$ENV{QUERY_STRING}/)) {
|
---|
38 | 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>";
|
---|
39 | die;
|
---|
40 | }
|
---|
41 |
|
---|
42 | #get the report for whjich details are to be viewed.
|
---|
43 | $etcfile=~/report-id := $ENV{QUERY_STRING}\&usabend\;\n/;
|
---|
44 | $report = $&;
|
---|
45 | $tmp=$';
|
---|
46 | $tmp=~/----------------------?/;
|
---|
47 | $report.=$`;
|
---|
48 | @pairs=split(/\&usabend\;\n/,$report);
|
---|
49 | foreach $pair (@pairs) {
|
---|
50 | ($name, $value)= split(/ := /,$pair);
|
---|
51 | #this adds html tags for breaks
|
---|
52 | $value =~ s/\n/\<br\>/g;
|
---|
53 | $reportvals{$name}=$value;
|
---|
54 | }
|
---|
55 |
|
---|
56 |
|
---|
57 |
|
---|
58 |
|
---|
59 | print "<p>Your automatically generated report ID number is: <b>$reportvals{\"report-id\"}</b>";
|
---|
60 | $reportid = $reportvals{"report-id"};
|
---|
61 | delete $reportvals{"report-id"};
|
---|
62 |
|
---|
63 | print "<h2>The following technical information was automatically collected about your problem:</h2>\n";
|
---|
64 | print "<table><width=\"100%\">\n";
|
---|
65 |
|
---|
66 | make_table_entry("The URL of the page where you were having problems","URL");
|
---|
67 | make_table_entry("the collection you were using when you had problems","collection");
|
---|
68 | make_table_entry("Time you opened the usability report window","opentime");
|
---|
69 | make_table_entry("Time you sent the usability report","sendtime");
|
---|
70 | make_table_entry("Time the report was received by the server","time");
|
---|
71 | make_table_entry("Your browser as it identifies itself","browser");
|
---|
72 | make_table_entry("Your browser as the server identifies it","browser-read-by-server");
|
---|
73 | make_table_entry("Your browser's IP number","browser-ip-no");
|
---|
74 | make_table_entry("The server's IP number","server-ip-no");
|
---|
75 | make_table_entry("Your language as recorded by your browser","language");
|
---|
76 | make_table_entry("The resolution of your screen","resolution");
|
---|
77 | make_table_entry("The colour of your screen","screencolour");
|
---|
78 | make_table_entry("The number of bits per pixel your display uses to represent colour","pixeldepth");
|
---|
79 | print "</table>";
|
---|
80 |
|
---|
81 | print "<h2>You provided us with the following extra information about the problem</h2>\n";
|
---|
82 |
|
---|
83 | print"<table>\n";
|
---|
84 | make_table_entry("How bad the problem was","severity");
|
---|
85 | make_table_entry("What kind of problem it was","probtype");
|
---|
86 | make_table_entry("Other details","moredetails");
|
---|
87 | print "</table>\n";
|
---|
88 |
|
---|
89 | print "<h2>The following data was automatically collected from the form on the Greenstone interface</h2>\n";
|
---|
90 |
|
---|
91 | print"<table>\n";
|
---|
92 | 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";
|
---|
93 |
|
---|
94 | foreach $key (keys(%reportvals)){
|
---|
95 | $key=~/-/;
|
---|
96 | print "<tr><td>$`</td><td>$'</td><td>$reportvals{$key}</td></tr>\n";
|
---|
97 | }
|
---|
98 | print "</table>\n";
|
---|
99 |
|
---|
100 | print "<br><br><p class=\"sans\"><a href=\"mailto:dmn@cs.waikato.ac.nz\">Contact us</a> with any queries or if you would like this report to be removed from the database. Please include your report ID number ($reportid) if your query concerns this report specifically.";
|
---|
101 |
|
---|
102 | print "</body></html>";
|
---|
103 |
|
---|
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};
|
---|
111 |
|
---|
112 | }
|
---|
113 |
|
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|
117 |
|
---|
118 |
|
---|
119 |
|
---|
120 |
|
---|
121 |
|
---|
122 |
|
---|
123 |
|
---|
124 |
|
---|
125 |
|
---|