| 1 |
csmall |
1.1 |
<? |
| 2 |
|
|
session_start(); |
| 3 |
|
|
include("config.inc"); |
| 4 |
|
|
include("common.inc"); |
| 5 |
|
|
|
| 6 |
|
|
/* How many applicants to display on the FD screen? */ |
| 7 |
|
|
$FD_MAX_APPLICANTS = 5; |
| 8 |
|
|
|
| 9 |
csmall |
1.5 |
function print_free_managers($db) { |
| 10 |
|
|
$sql = "select a.manager, (max(m.max_applicants) - count(a.email)) as freeslots from applicant a, manager m where approved is null and m.login = a.manager group by a.manager HAVING max(m.max_applicants) > count(a.email)"; |
| 11 |
|
|
if (! ($query = pg_exec($db, $sql))) { |
| 12 |
|
|
echo "Problem with query", pg_ErrorMessage($db), "<BR>"; |
| 13 |
|
|
echo "SQL was: $sql<BR>"; |
| 14 |
|
|
return; |
| 15 |
|
|
} |
| 16 |
|
|
$rows = pg_NumRows($query); |
| 17 |
|
|
if ($rows == 0) { |
| 18 |
tbm |
1.8 |
echo "<P>No Applicaton Managers have free slots (not necessarily correct)."; |
| 19 |
csmall |
1.5 |
return; |
| 20 |
|
|
} |
| 21 |
tbm |
1.8 |
echo "<P>The folllowing managers have free slots (not necessarily including everyone): "; |
| 22 |
csmall |
1.5 |
for ($i = 0; $i < $rows ; $i++) { |
| 23 |
|
|
$row = pg_Fetch_Array($query, $i); |
| 24 |
|
|
echo $row["manager"], " ( ", $row["freeslots"], " ) "; |
| 25 |
|
|
} |
| 26 |
|
|
} |
| 27 |
|
|
|
| 28 |
|
|
|
| 29 |
csmall |
1.1 |
function print_applicants($db, $sql,$limit) { |
| 30 |
|
|
if (! ($query = pg_exec($db, $sql))) { |
| 31 |
|
|
echo "Problem with query", pg_ErrorMessage($db), "<BR>"; |
| 32 |
|
|
echo "SQL was: $sql<BR>\n"; |
| 33 |
|
|
return FALSE; |
| 34 |
|
|
} |
| 35 |
|
|
echo "<TABLE border=\"0\" summary=\"\">\n"; |
| 36 |
|
|
$rows = pg_NumRows($query); |
| 37 |
|
|
if ($limit != 0 && $rows > $limit) { $rows = $limit; } |
| 38 |
|
|
for ($i = 0 ; $i < $rows ; $i++) { |
| 39 |
|
|
$row = pg_Fetch_Array($query, $i); |
| 40 |
|
|
echo "<TR>"; |
| 41 |
csmall |
1.3 |
print_flag($row["advocate_ok"],"<TD><IMG src=\"/images/shake.png\" alt=\"V\"></TD>","<TD> </TD>"); |
| 42 |
csmall |
1.1 |
print_flag($row["id_ok"],"<TD><IMG src=\"/images/mag.png\" alt=\"I\"></TD>","<TD> </TD>"); |
| 43 |
|
|
print_flag($row["pnp_ok"],"<TD><IMG src=\"/images/dfsg.png\" alt=\"P\"></TD>","<TD> </TD>"); |
| 44 |
|
|
print_flag($row["tns_ok"],"<TD><IMG src=\"/images/hammer.png\" alt=\"T\"></TD>","<TD> </TD>"); |
| 45 |
|
|
print_flag($row["approved"],"<TD><IMG src=\"/images/thumb.png\" alt=\"A\"></TD>","<TD> </TD>"); |
| 46 |
|
|
print_flag($row["da_approved"],"<TD><IMG src=\"/images/new.png\" alt=\"N\"></TD>","<TD> </TD>"); |
| 47 |
|
|
if ($row["approved"] == "f" || $row["da_approved"] == "f") { |
| 48 |
|
|
echo "<TD><IMG src=\"/images/hold.png\" alt=\"H\"></TD>"; |
| 49 |
|
|
} else { |
| 50 |
|
|
echo "<TD> </TD>"; |
| 51 |
|
|
} |
| 52 |
|
|
echo "<TD><A href=\"amstatus.php?"; ?><?=SID?><?; |
| 53 |
|
|
echo "&user=", urlencode($row["email"]), "\">", |
| 54 |
|
|
$row["forename"], " ", $row["surname"], " <", |
| 55 |
|
|
$row["email"], "></A></TD>", |
| 56 |
|
|
"<TD> (", $row["manager"], ") </TD></TR>\n"; |
| 57 |
|
|
} |
| 58 |
|
|
echo "</TABLE>\n"; |
| 59 |
|
|
|
| 60 |
|
|
return TRUE; |
| 61 |
|
|
}?> |
| 62 |
|
|
#use wml::nmpage title="Debian New Maintainer - AM Main Page" |
| 63 |
|
|
<? |
| 64 |
|
|
|
| 65 |
|
|
if (!session_is_registered("s_username") || !session_is_registered("s_isam")) { |
| 66 |
|
|
?> |
| 67 |
|
|
<STRONG> |
| 68 |
|
|
You should not be here!!</STRONG> |
| 69 |
|
|
<? } else { |
| 70 |
|
|
session_register("s_username"); |
| 71 |
|
|
session_register("s_isam"); |
| 72 |
|
|
session_register("s_isfd"); |
| 73 |
|
|
session_register("s_isdam"); |
| 74 |
|
|
if (($db = open_db())) { |
| 75 |
|
|
?> |
| 76 |
|
|
<H1>Debian New Maintainer</H1><BR> |
| 77 |
|
|
<P>Currently the database thinks you have the following functions: |
| 78 |
|
|
<UL> |
| 79 |
|
|
<LI>Application Manager |
| 80 |
|
|
<? if ($s_isfd == 't') { ?> <LI>Front Desk <? } ?> |
| 81 |
|
|
<? if ($s_isdam == 't') { ?> <LI>Debian Accounts Manager <? } ?> |
| 82 |
|
|
</UL> |
| 83 |
|
|
<? if ($s_isfd == 't') { ?> |
| 84 |
|
|
<H3>Front Desk</H3> |
| 85 |
csmall |
1.5 |
<? print_free_managers($db); ?> |
| 86 |
|
|
<BR> |
| 87 |
csmall |
1.1 |
<P>The following applicants are waiting for an Application Manager to be |
| 88 |
|
|
assigned (only the first <? echo $FD_MAX_APPLICANTS; ?> have been |
| 89 |
|
|
displayed here).<BR> |
| 90 |
|
|
<? |
| 91 |
csmall |
1.2 |
$sql = "SELECT * from applicant WHERE ( manager IS NULL OR manager = '' ) AND advocate_checked IS NOT NULL ORDER BY apply_date"; |
| 92 |
csmall |
1.1 |
print_applicants($db, $sql,$FD_MAX_APPLICANTS); |
| 93 |
|
|
?> |
| 94 |
|
|
<P>Applicants assigned to AM but AM has not confirmed:<BR> |
| 95 |
|
|
<? |
| 96 |
csmall |
1.2 |
$sql = "SELECT * from applicant WHERE manager IS NOT NULL AND am_confirm_date IS NULL ORDER BY apply_date"; |
| 97 |
csmall |
1.1 |
print_applicants($db, $sql,0); |
| 98 |
|
|
?> |
| 99 |
|
|
<P>Applicants assigned to AM but AM has rejected assignment:<BR> |
| 100 |
|
|
<? |
| 101 |
|
|
$sql = "SELECT * from applicant WHERE manager IS NOT NULL AND am_confirm = 'f' ORDER BY apply_date"; |
| 102 |
|
|
print_applicants($db, $sql,0); |
| 103 |
|
|
?> |
| 104 |
|
|
<? } #End of Front Desk ?> |
| 105 |
|
|
<? if ($s_isdam == 't') { ?> |
| 106 |
|
|
<H3>Debian Accounts Manager</H3> |
| 107 |
|
|
<P>The following applicants have been approved by the NM committee |
| 108 |
|
|
but a DAM has not fully processed them yet:<BR> |
| 109 |
|
|
<? |
| 110 |
|
|
$sql = "SELECT * from applicant WHERE manager IS NOT NULL AND approved = 't' AND decision IS NOT NULL AND (application_ok IS NULL OR application_ok = 't') AND ( da_approved IS NULL OR ( da_approved = 't' AND newmaint IS NULL )) ORDER BY apply_date, decision"; |
| 111 |
|
|
print_applicants($db, $sql,0); |
| 112 |
|
|
?> |
| 113 |
|
|
<P>These applications have been approved by the NM committee but for some |
| 114 |
|
|
reason the DAM has considered the application incomplete:<BR> |
| 115 |
|
|
<? |
| 116 |
|
|
$sql = "SELECT * from applicant WHERE manager IS NOT NULL AND approved = 't' AND decision IS NOT NULL AND application_ok = 'f' AND ( da_approved IS NULL OR ( da_approved = 't' AND newmaint IS NULL )) ORDER BY apply_date, decision"; |
| 117 |
|
|
print_applicants($db, $sql,0); |
| 118 |
|
|
?> |
| 119 |
csmall |
1.6 |
<P>These are applications that have been put on hold at the DAM stage:<BR> |
| 120 |
|
|
<? |
| 121 |
|
|
$sql = "SELECT * from applicant WHERE manager IS NOT NULL AND approved = 't' AND decision IS NOT NULL AND da_approved = 'f' ORDER BY apply_date, decision"; |
| 122 |
|
|
print_applicants($db, $sql,0); |
| 123 |
|
|
?> |
| 124 |
csmall |
1.1 |
<? } # DAM stuff ?> |
| 125 |
|
|
<H3>Application Manager</H3> |
| 126 |
|
|
<P>Hello <? echo $s_username; ?>, here is a list of New Maintainer applicants |
| 127 |
|
|
that you are the AM for:<BR> |
| 128 |
|
|
<H5>Applicants to Accept</H5> |
| 129 |
|
|
<P>These applicants have been assigned to you by the Front Desk but you have |
| 130 |
|
|
not confirmed that you will or will not be their AM. These applicants are |
| 131 |
|
|
ordered by application date.<BR> |
| 132 |
|
|
<? |
| 133 |
|
|
$sql = "SELECT * FROM applicant WHERE manager = '$s_username' AND am_confirm IS NULL ORDER BY apply_date"; |
| 134 |
|
|
print_applicants($db, $sql,0); |
| 135 |
|
|
?> |
| 136 |
|
|
<H5>Applicants to process</H5> |
| 137 |
|
|
<P>The following applicants you are the AM for and you have accepted being |
| 138 |
|
|
their AM but they have not passed through the whole NM process yet.<BR> |
| 139 |
|
|
<? |
| 140 |
|
|
$sql = "SELECT * FROM applicant WHERE manager = '$s_username' AND am_confirm = 't' AND approved IS NULL ORDER BY apply_date"; |
| 141 |
|
|
print_applicants($db, $sql,0); |
| 142 |
|
|
?> |
| 143 |
|
|
<H5>Applicants needing re-processing</H5> |
| 144 |
|
|
<P>These applicants you have processed but the DAM believe the documenation is |
| 145 |
|
|
incomplete. Check the DAM comments field for details:<BR> |
| 146 |
|
|
<? |
| 147 |
|
|
$sql = "SELECT * FROM applicant WHERE manager = '$s_username' AND am_confirm = 't' AND approved = 't' AND application_ok = 'f' ORDER BY apply_date"; |
| 148 |
|
|
print_applicants($db, $sql,0); |
| 149 |
|
|
?> |
| 150 |
|
|
|
| 151 |
|
|
<H5>Processed Applicants</H5> |
| 152 |
|
|
<P>These applicants you have processed through the system and are here for |
| 153 |
|
|
historical or informational purposes.<BR> |
| 154 |
|
|
<? |
| 155 |
|
|
$sql = "SELECT * FROM applicant WHERE manager = '$s_username' AND am_confirm = 't' AND approved = 't' AND ( application_ok = 't' OR application_ok IS NULL) ORDER BY apply_date"; |
| 156 |
|
|
print_applicants($db, $sql,0); |
| 157 |
|
|
?> |
| 158 |
|
|
<H5>Applicants on Hold</H5> |
| 159 |
tbm |
1.9 |
<P>Applicants who make it here have some issue with completing the process but |
| 160 |
|
|
are expected to be able to work around that soon.<BR> |
| 161 |
csmall |
1.1 |
<? |
| 162 |
|
|
$sql = "SELECT * FROM applicant WHERE manager = '$s_username' AND approved = 'f' ORDER BY apply_date"; |
| 163 |
|
|
print_applicants($db, $sql,0); |
| 164 |
|
|
?> |
| 165 |
|
|
|
| 166 |
|
|
<H5>Rejected Applicants</H5> |
| 167 |
csmall |
1.7 |
<P>These are applicants that were assigned to you, but you have rejected |
| 168 |
|
|
being their AM.<BR> |
| 169 |
csmall |
1.1 |
<? |
| 170 |
|
|
$sql = "SELECT * FROM applicant WHERE manager = '$s_username' AND am_confirm = 'f' ORDER BY apply_date"; |
| 171 |
|
|
print_applicants($db, $sql,0); |
| 172 |
|
|
?> |
| 173 |
|
|
<H3>Key</H3> |
| 174 |
|
|
<UL> |
| 175 |
csmall |
1.3 |
<LI><IMG src="/images/shake.png" alt="V"> : Advocate Check ok |
| 176 |
csmall |
1.1 |
<LI><IMG src="/images/mag.png" alt="I"> : Identification complete |
| 177 |
|
|
<LI><IMG src="/images/dfsg.png" alt="P"> : Philosopy and Procedures complete |
| 178 |
|
|
<LI><IMG src="/images/hammer.png" alt="T"> : Tasks and Skills complete |
| 179 |
|
|
<LI><IMG src="/images/thumb.png" alt="A"> : Application Manager Recommends applicant |
| 180 |
|
|
<LI><IMG src="/images/new.png" alt="N"> : New Debian maintainer |
| 181 |
|
|
<LI><IMG src="/images/hold.png" alt="H"> : On hold |
| 182 |
|
|
</UL> |
| 183 |
|
|
|
| 184 |
|
|
<? } # db ok |
| 185 |
|
|
} # Registered session ?> |