1 //
2 // aegis - project change supervisor
3 // Copyright (C) 2004-2008 Peter Miller
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see
17 // <http://www.gnu.org/licenses/>.
18 //
19
20 #include <common/ac/stdio.h>
21
22 #include <libaegis/change.h>
23 #include <libaegis/change/file.h>
24 #include <libaegis/http.h>
25 #include <libaegis/project/file.h>
26
27 #include <aeget/get/change/file_invento.h>
28
29
30 void
get_change_file_inventory(change::pointer cp,string_ty *,string_list_ty *)31 get_change_file_inventory(change::pointer cp, string_ty *, string_list_ty *)
32 {
33 html_header(0, cp);
34 printf("<title>Project\n");
35 html_encode_string(project_name_get(cp->pp));
36 if (!cp->bogus)
37 printf(", Change %ld", magic_zero_decode(cp->number));
38 printf(", File Inventory\n");
39 printf("</title></head><body>\n");
40 html_header_ps(0, cp);
41 printf("<h1 align=center>\n");
42 emit_change(cp);
43 printf(",<br>\nFile Inventory</h1>\n");
44 printf("<div class=\"information\">\n");
45
46 printf("<table align=center>\n");
47 printf("<tr class=\"even-group\"><th>File Name</th><th>UUID</th></tr>\n");
48
49 size_t j;
50 for (j = 0; ; ++j)
51 {
52 fstate_src_ty *src = 0;
53 if (cp->bogus)
54 src = cp->pp->file_nth(j, view_path_extreme);
55 else
56 src = change_file_nth(cp, j, view_path_first);
57 if (!src)
58 break;
59
60 printf("<tr class=\"%s-group\">", (j % 6 < 3 ? "odd" : "even"));
61 printf("<td valign=top>\n");
62 emit_file_href(cp, src->file_name, "menu");
63 printf("<span class=\"filename\">");
64 html_encode_string(src->file_name);
65 printf("</span></a></td>\n<td>");
66 if (src->uuid)
67 {
68 printf("<tt>");
69 html_encode_string(src->uuid);
70 printf("</tt>");
71 }
72 printf("</td></tr>\n");
73 }
74 printf("<tr class=\"even-group\"><td colspan=4>\n");
75 printf("Listed %ld files.\n", (long)j);
76 printf("</td></tr>\n");
77 printf("</table>\n");
78 printf("</div>\n");
79
80 printf("<hr>A similar report may be obtained from the command line,\n");
81 printf("with the following command:\n<blockquote><pre>");
82 if (!cp->bogus)
83 {
84 printf("ael cfin -p ");
85 html_encode_string(project_name_get(cp->pp));
86 printf(" -c %ld", magic_zero_decode(cp->number));
87 }
88 else
89 {
90 printf("ael pfin -p ");
91 html_encode_string(project_name_get(cp->pp));
92 }
93 printf("</pre></blockquote>\n");
94
95 printf("<hr>\n");
96 printf("<p align=center class=\"navbar\">[\n");
97 printf("<a href=\"%s/\">Project List</a> |\n", http_script_name());
98 emit_project_href(cp->pp, "menu");
99 printf("Project Menu</a> |\n");
100 emit_project_href(cp->pp, "changes");
101 printf("Change List</a>\n");
102 if (!cp->bogus)
103 {
104 printf("| ");
105 emit_change_href(cp, "menu");
106 printf("Change Menu</a>\n");
107 }
108 printf("]</p>\n");
109
110 html_footer(0, cp);
111 }
112