/*
* aegis - project change supervisor
* Copyright (C) 1997, 1998, 2000, 2001 Peter Miller;
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
* MANIFEST: report the active files in a project
*/
auto script_name;
script_name = getenv("SCRIPT_NAME");
if (script_name == "")
script_name = "http://localhost/cgi-bin/aegis.cgi";
columns({width = 1000;});
print("Content-Type: text/html");
print("");
print("
");
print("File Activity");
print("");
if (change_number_set())
{
print("Project ``" ## quote_html(project_name()) ##
"'', Change " ## change_number() ## ",
");
}
else
{
print("Project ``" ## quote_html(project_name()) ## "'',
");
}
print("File Activity");
print("
");
/*
* get the project state
*/
auto ps, ps_nobr;
ps_nobr = project[project_name()].state;
ps = ps_nobr.branch;
/*
* default to all project files
* if no files named on the command line
*/
auto file;
if (count(arg) == 0)
{
if (change_number_set())
{
for (file in ps.change[change_number()].src)
arg ##= file.file_name;
}
else
{
for (file in ps_nobr.src)
arg ##= file.file_name;
}
}
/*
* check the files in every active change
*/
auto cn, cs, ch;
auto active;
active = {};
for (cn in keys(ps.change))
{
cs = ps.change[cn];
if (cs.state < being_developed || cs.state >= completed)
continue;
for (file in cs.src)
{
if (!(file.file_name in arg))
continue;
if (file.usage == build && file.action == modify)
continue;
if (!(file.file_name in keys(active)))
active[file.file_name] = [];
auto developer, integrator;
developer = "";
integrator = "";
for (ch in cs.history)
{
if (ch.what == develop_begin)
developer = ch.who;
else if (ch.what == integrate_begin)
integrator = ch.who;
else if (ch.what == integrate_begin_undo)
integrator = "";
else if (ch.what == integrate_fail)
integrator = "";
}
active[file.file_name] ##=
{
usage = file.usage;
action = file.action;
edit =
(
file.edit_number_origin != ""
?
(
file.edit_number != ""
?
(file.edit_number_origin ## " -> " ## file.edit_number)
:
file.edit_number_origin
)
:
file.edit_number
);
who = (cs.state == being_developed ? developer
: cs.state == being_integrated
? integrator : "");
change = cn;
state = cs.state;
description = cs.brief_description;
};
}
}
/*
* list all of the active files
*/
auto fn, num_active, email, long_name;
num_active = 0;
print("");
for (fn in sort(keys(active)))
{
if (count(active[fn]) < 1)
continue;
print("- ");
auto href;
href = script_name ## "?file@file_menu+" ## quote_url(fn);
href ##= "+project@" ## quote_url(project_name());
print("");
print("" ## quote_html(fn) ## "");
print("
- ");
print("
");
print("Action | Type | Edit | ");
print("Change | State | Description |
");
++num_active;
auto actions, usages;
actions = "BS";
usages = "BS";
for (file in active[fn])
{
print("");
if (file.usage != usages)
print(file.usage);
print(" | ");
if (file.action != actions)
print(file.action);
print(" | ");
print(file.edit);
print(" | ");
href = script_name ## "?file@chan_menu";
href ##= "+project@" ## quote_url(project_name());
href ##= "+change@" ## file.change;
print("");
print(file.change ## "");
print(" | ");
print(file.state);
if (file.who != "")
{
email = file.who;
try { email = user[file.who].email_address; }
catch (email) { email = ""; }
if (email == "")
email = file.who;
print(" ");
long_name = file.who;
try { long_name = passwd[file.who].pw_comment; }
catch (long_name) { long_name = file.who; }
print(quote_html(long_name) ## "");
}
print(" | ");
print(quote_html(file.description));
print(" |
");
actions = file.action;
usages = file.usage;
}
print("
");
}
print("
");
if (num_active == 1)
print("Listed one active file.");
else if (num_active)
print("Listed " ## num_active ## " active files.");
else
print("There are no active files in this project.");
print("
");
print("A similar report may be obtained from the command line, with");
print("aer file_activ -p " ## quote_html(project_name()) ##
"
");
print("
");
print("This page was generated " ## now() ## ".");
print("");