source: trunk/gsdl/cgi-bin/readresults.cgi@ 4130

Last change on this file since 4130 was 4114, checked in by dana, 21 years ago

reflecting that collection information is retireved by base.dm/usabilityscript

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1#!/usr/bin/perl
2
3use usabcgi;
4
5print "Content-type:text/html\n\n";
6
7
8print "<html><head><title>Greenstone Usability - Report Details</title>\n";
9usabcgi::printscript;
10usabcgi::printstyle($ENV{HTTP_USER_AGENT});
11
12print "</head><body bgcolor=\"#ffffff\">\n";
13
14($imageloc) = usabcgi::get_config_info("httpimg");
15if(!($imageloc =~ "http")) {$imageloc="http://".$ENV{HTTP_HOST}.$imageloc;}
16
17print "<table width=\"100%\"><tr>\n<td><h1>Greenstone Usability - Report Details</h1></td>\n";
18print "<td align=\"right\">";
19if ($imageloc) { print "<img src=\"$imageloc\/usabbanner.gif\" alt=\"Greenstonekoru design\" title=\"Greenstone koru design\">"; }
20print "</td>\n</tr></table>";
21usabcgi::printaplinks;
22
23if((!($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");
29if(!($etcfileloc =~/\/$/)) {$etcfileloc.="/";}
30$etcfileloc .= "etc/usability.txt";
31open (FILEIN, $etcfileloc) or die "could not open usability.txt\n";
32while(<FILEIN>){
33 $etcfile.=$_;
34}
35close(FILEIN);
36
37if(!($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);
49foreach $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
59print "<p>Your automatically generated report ID number is: <b>$reportvals{\"report-id\"}</b>";
60$reportid = $reportvals{"report-id"};
61delete $reportvals{"report-id"};
62
63print "<h2>The following technical information was automatically collected about your problem:</h2>\n";
64print "<table><width=\"100%\">\n";
65
66make_table_entry("The URL of the page where you were having problems","URL");
67make_table_entry("the collection you were using when you had problems","collection");
68make_table_entry("Time you opened the usability report window","opentime");
69make_table_entry("Time you sent the usability report","sendtime");
70make_table_entry("Time the report was received by the server","time");
71make_table_entry("Your browser as it identifies itself","browser");
72make_table_entry("Your browser as the server identifies it","browser-read-by-server");
73make_table_entry("Your browser's IP number","browser-ip-no");
74make_table_entry("The server's IP number","server-ip-no");
75make_table_entry("Your language as recorded by your browser","language");
76make_table_entry("The resolution of your screen","resolution");
77make_table_entry("The colour of your screen","screencolour");
78make_table_entry("The number of bits per pixel your display uses to represent colour","pixeldepth");
79print "</table>";
80
81print "<h2>You provided us with the following extra information about the problem</h2>\n";
82
83print"<table>\n";
84make_table_entry("How bad the problem was","severity");
85make_table_entry("What kind of problem it was","probtype");
86make_table_entry("Other details","moredetails");
87print "</table>\n";
88
89print "<h2>The following data was automatically collected from the form on the Greenstone interface</h2>\n";
90
91print"<table>\n";
92print "<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
94foreach $key (keys(%reportvals)){
95 $key=~/-/;
96 print "<tr><td>$`</td><td>$'</td><td>$reportvals{$key}</td></tr>\n";
97}
98print "</table>\n";
99
100print "<br><br><p class=\"sans\"><a href=\"mailto:dmn&#064;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
102print "</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
106sub 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
Note: See TracBrowser for help on using the repository browser.