2004-12-11 19:41:51 +00:00
< ? php
2004-12-12 03:51:51 +00:00
/*************************************/
/* code to View and approve new Apps */
/*************************************/
2004-12-11 19:41:51 +00:00
2004-03-15 16:22:00 +00:00
include ( " path.php " );
2005-01-30 00:57:34 +00:00
require ( BASE . " include/incl.php " );
require ( BASE . " include/tableve.php " );
require ( BASE . " include/application.php " );
require ( BASE . " include/mail.php " );
2004-03-15 16:22:00 +00:00
2005-02-07 23:21:33 +00:00
function get_vendor_from_keywords ( $sKeywords )
{
$aKeywords = explode ( " *** " , $keywords );
$iLastElt = ( sizeOf ( $aKeywords ) - 1 );
return ( $aKeywords [ $iLastElt ]);
}
2005-06-12 18:48:53 +00:00
/* allows the admin to click on a row and mark the current application as a duplicate */
/* of the selected application */
function outputSearchTableForDuplicateFlagging ( $currentAppId , $hResult )
{
if (( $hResult == null ) || ( mysql_num_rows ( $hResult ) == 0 ))
{
// do nothing, we have no results
} else
{
echo html_frame_start ( " " , " 98% " , " " , 0 );
echo " <table width='100%' border=0 cellpadding=3 cellspacing=1> \n \n " ;
$c = 0 ;
while ( $ob = mysql_fetch_object ( $hResult ))
{
//skip if a NONAME
if ( $ob -> appName == " NONAME " ) { continue ; }
//set row color
$bgcolor = ( $c % 2 ) ? 'color0' : 'color1' ;
//count versions
$query = query_appdb ( " SELECT count(*) as versions FROM appVersion WHERE appId = $ob->appId AND versionName != 'NONAME' " );
$y = mysql_fetch_object ( $query );
//display row
echo " <tr class= $bgcolor > \n " ;
/* map the merging of the current app to the app we are displaying in the table */
echo " <td> " . html_ahref ( $ob -> appName , " adminAppQueue.php?sub=duplicate&appId= " . $currentAppId . " &appIdMergeTo= " . $ob -> appId ) . " </td> \n " ;
echo " <td> $y->versions versions </td> \n " ;
echo " </tr> \n \n " ;
$c ++ ;
//set row color
$bgcolor = ( $c % 2 ) ? 'color0' : 'color1' ;
/* add the versions to the table */
$oApp = new Application ( $ob -> appId );
foreach ( $oApp -> aVersionsIds as $iVersionId )
{
$oVersion = new Version ( $iVersionId );
echo " <tr class= $bgcolor ><td></td><td> " . $oVersion -> sName . " </td></tr> \n " ;
}
$c ++ ;
}
echo " </table> \n \n " ;
echo html_frame_end ();
}
}
2004-03-15 16:22:00 +00:00
//deny access if not logged in
2005-01-30 23:12:48 +00:00
if ( ! $_SESSION [ 'current' ] -> hasPriv ( " admin " ))
2004-03-15 16:22:00 +00:00
{
2004-12-29 20:21:31 +00:00
errorpage ( " Insufficient privileges. " );
2004-03-15 16:22:00 +00:00
exit ;
}
2004-12-10 01:07:45 +00:00
if ( $_REQUEST [ 'sub' ])
2004-03-15 16:22:00 +00:00
{
2005-02-07 23:21:33 +00:00
if ( is_numeric ( $_REQUEST [ 'appId' ]))
2005-01-10 22:10:41 +00:00
{
2005-02-07 23:21:33 +00:00
$oApp = new Application ( $_REQUEST [ 'appId' ]);
2005-06-12 18:48:53 +00:00
/* if we are processing a queued application there MUST be an implicitly queued */
/* version to go along with it. Find this version so we can display its information */
/* during application processing so the admin can make a better choice about */
/* whether to accept or reject the overall application */
$sQuery = " Select versionId from appVersion where appId=' " . $_REQUEST [ 'appId' ] . " '; " ;
$hResult = query_appdb ( $sQuery );
$oRow = mysql_fetch_object ( $hResult );
$oVersion = new Version ( $oRow -> versionId );
2005-02-07 23:21:33 +00:00
} elseif ( is_numeric ( $_REQUEST [ 'versionId' ]))
2004-03-15 16:22:00 +00:00
{
2005-02-07 23:21:33 +00:00
$oVersion = new Version ( $_REQUEST [ 'versionId' ]);
} else
2004-03-15 16:22:00 +00:00
{
//error no Id!
2004-11-17 23:04:43 +00:00
addmsg ( " Application Not Found! " , " red " );
redirect ( apidb_fullurl ( " admin/adminAppQueue.php " ));
2004-03-15 16:22:00 +00:00
}
//process according to sub flag
2005-02-07 23:21:33 +00:00
if ( $_REQUEST [ 'sub' ] == 'view' )
2004-03-15 16:22:00 +00:00
{
2004-10-12 21:11:59 +00:00
$x = new TableVE ( " view " );
2004-11-17 23:04:43 +00:00
apidb_header ( " Admin App Queue " );
2005-02-07 23:21:33 +00:00
?>
< link rel = " stylesheet " href = " ./application.css " type = " text/css " >
<!-- load HTMLArea -->
< script type = " text/javascript " src = " ../htmlarea/htmlarea_loader.js " ></ script >
< ? php
2004-11-17 23:04:43 +00:00
echo '<form name="qform" action="adminAppQueue.php" method="post" enctype="multipart/form-data">' , " \n " ;
2005-02-07 23:21:33 +00:00
echo '<input type="hidden" name="sub" value="add">' , " \n " ;
2004-11-17 23:04:43 +00:00
2005-05-14 00:42:25 +00:00
echo html_back_link ( 1 , 'adminAppQueue.php' );
2005-06-12 18:48:53 +00:00
if ( ! $oApp ) //app version
2004-11-09 22:34:49 +00:00
{
2005-05-20 02:45:55 +00:00
echo html_frame_start ( " Potential duplicate versions in the database " , " 90% " , " " , 0 );
$oApp = new Application ( $oVersion -> iAppId );
display_versions ( $oApp -> iAppId , $oApp -> aVersionsIds );
echo html_frame_end ( " " );
2004-11-09 22:34:49 +00:00
//help
echo " <div align=center><table width='90%' border=0 cellpadding=3 cellspacing=0><tr><td> \n \n " ;
2005-02-07 23:21:33 +00:00
echo " <p>This is the full view of the application version waiting to be approved. \n " ;
echo " If you approve this application version an email will be sent to the author of the submission.<p> \n " ;
2004-11-09 22:34:49 +00:00
2005-02-07 23:21:33 +00:00
echo " <b>App Version</b> This type of application will be nested under the selected application parent. \n " ;
2005-01-29 00:43:41 +00:00
echo " <p>Click delete to remove the selected item from the queue an email will automatically be sent to the \n " ;
echo " submitter to let him know the item was deleted.</p> \n \n " ;
2004-11-09 22:34:49 +00:00
echo " </td></tr></table></div> \n \n " ;
2005-02-07 23:21:33 +00:00
echo html_frame_start ( " New Version Form " , 400 , " " , 0 );
2004-11-09 22:34:49 +00:00
echo " <table width='100%' border=0 cellpadding=2 cellspacing=0> \n " ;
//app parent
2005-02-07 23:21:33 +00:00
echo '<tr valign=top><td class=color0><b>Application</b></td><td>' , " \n " ;
2005-02-19 01:19:43 +00:00
$x -> make_option_list ( " appId " , $oVersion -> iAppId , " appFamily " , " appId " , " appName " );
2004-11-09 22:34:49 +00:00
echo '</td></tr>' , " \n " ;
//version
2005-02-07 23:21:33 +00:00
echo '<tr valign=top><td class="color0"><b>Version name</b></td>' , " \n " ;
echo '<td><input type=text name="versionName" value="' . $oVersion -> sName . '" size="20"></td></tr>' , " \n " ;
2004-11-09 22:34:49 +00:00
2005-02-07 23:21:33 +00:00
echo '<tr valign=top><td class=color0><b>Description</b></td>' , " \n " ;
2005-06-23 00:10:03 +00:00
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor" name="versionDescription">' . $oVersion -> sDescription . '</textarea></p></td></tr>' , " \n " ;
2005-02-07 23:21:33 +00:00
echo '<tr valign=top><td class="color0"><b>email Text</b></td>' , " \n " ;
2005-02-27 16:45:49 +00:00
echo '<td><textarea name="replyText" rows="10" cols="35"></textarea></td></tr>' , " \n " ;
2005-02-07 23:21:33 +00:00
echo '<tr valign=top><td class=color3 align=center colspan=2>' , " \n " ;
echo '<input type="hidden" name="versionId" value="' . $oVersion -> iVersionId . '" />' ;
2005-02-09 02:17:31 +00:00
echo '<input type="submit" value=" Submit Version Into Database " class="button"> ' , " \n " ;
echo '<input name="sub" type=submit value="Delete" class="button"></td></tr>' , " \n " ;
echo '</table></form>' , " \n " ;
2005-02-07 23:21:33 +00:00
} else // application
2004-11-09 22:34:49 +00:00
{
2005-05-14 00:42:25 +00:00
echo html_frame_start ( " Potential duplicate applications in the database " , " 90% " , " " , 0 );
2005-06-08 00:35:30 +00:00
perform_search_and_output_results ( $oApp -> sName );
2005-05-14 00:42:25 +00:00
echo html_frame_end ( " " );
2005-06-12 18:48:53 +00:00
echo html_frame_start ( " Delete application as duplicate of this application: " , " 90% " , " " , 0 );
echo " Clicking on an entry in this table will delete this application. " ;
echo " It will also modify the version " ;
echo " application to have an appId of the existing application and keep it queued for processing " ;
$hResult = searchForApplication ( $oApp -> sName );
outputSearchTableForDuplicateFlagging ( $oApp -> iAppId , $hResult );
$hResult = searchForApplicationFuzzy ( $oApp -> sName , 60 );
outputSearchTableForDuplicateFlagging ( $oApp -> iAppId , $hResult );
echo html_frame_end ( " " );
2004-11-09 22:34:49 +00:00
//help
echo " <div align=center><table width='90%' border=0 cellpadding=3 cellspacing=0><tr><td> \n \n " ;
echo " <p>This is the full view of the application waiting to be approved. \n " ;
echo " You need to pick a category before submitting \n " ;
echo " it into the database. If you approve this application, \n " ;
echo " an email will be sent to the author of the submission.<p> \n " ;
2004-11-17 23:04:43 +00:00
echo " <p>Click delete to remove the selected item from the queue. An email will automatically be sent to the \n " ;
echo " submitter to let them know the item was deleted.</p> \n \n " ;
2004-11-09 22:34:49 +00:00
echo " </td></tr></table></div> \n \n " ;
//view application details
echo html_frame_start ( " New Application Form " , 400 , " " , 0 );
echo " <table width='100%' border=0 cellpadding=2 cellspacing=0> \n " ;
//category
2005-02-07 23:21:33 +00:00
echo '<tr valign=top><td class="color0>"<b>Category</b></td><td>' , " \n " ;
$x -> make_option_list ( " catId " , $oApp -> iCatId , " appCategory " , " catId " , " catName " );
2004-10-12 21:11:59 +00:00
echo '</td></tr>' , " \n " ;
2004-11-09 22:34:49 +00:00
//name
2005-02-07 23:21:33 +00:00
echo '<tr valign=top><td class="color0"><b>App Name</b></td>' , " \n " ;
echo '<td><input type="text" name="appName" value="' . $oApp -> sName . '" size=20></td></tr>' , " \n " ;
2004-10-12 21:11:59 +00:00
2005-02-07 23:21:33 +00:00
/*
* vendor / alt vendor fields
* if user selected a predefined vendorId :
*/
$iVendorId = $oApp -> iVendorId ;
/*
* If not , try for an exact match
* Use the first match if we found one and clear out the vendor field ,
* otherwise don ' t pick a vendor
* N . B . The vendor string is the last word of the keywords field !
*/
if ( ! $iVendorId )
2004-11-09 22:34:49 +00:00
{
2005-02-07 23:21:33 +00:00
$sVendor = get_vendor_from_keywords ( $oApp -> sKeywords );
$sQuery = " SELECT vendorId FROM vendor WHERE vendorname = ' " . $sVendor . " '; " ;
$hResult = query_appdb ( $sQuery );
if ( $hResult )
2004-11-09 22:34:49 +00:00
{
2005-02-07 23:21:33 +00:00
$oRow = mysql_fetch_object ( $hResult );
$iVendorId = $oRow -> vendorId ;
2004-11-09 22:34:49 +00:00
}
}
2004-10-12 21:11:59 +00:00
2005-02-07 23:21:33 +00:00
/*
* try for a partial match
*/
if ( ! $iVendorId )
2004-11-09 22:34:49 +00:00
{
2005-02-07 23:21:33 +00:00
$sQuery = " select * from vendor where vendorname like '% $ob->queueVendor %'; " ;
$hResult = query_appdb ( $sQuery );
if ( $hResult )
{
$oRow = mysql_fetch_object ( $hResult );
$iVendorId = $oRow -> vendorId ;
}
2004-11-09 22:34:49 +00:00
}
2005-02-02 04:11:41 +00:00
2005-02-07 23:21:33 +00:00
//vendor field
if ( $iVendorId )
$sVendor = " " ;
echo '<tr valign=top><td class="color0"><b>App Vendor</b></td>' , " \n " ;
echo '<td><input type=text name="sVendor" value="' . $sVendor . '" size="20"></td>' , " \n " ;
echo '</tr>' , " \n " ;
echo '<tr valign=top><td class="color0"> </td><td>' , " \n " ;
$x -> make_option_list ( " vendorId " , $iVendorId , " vendor " , " vendorId " , " vendorName " );
echo '</td></tr>' , " \n " ;
//url
echo '<tr valign=top><td class="color0"><b>App URL</b></td>' , " \n " ;
echo '<td><input type=text name="webpage" value="' . $oApp -> sWebpage . '" size="20"></td></tr>' , " \n " ;
2005-06-12 18:48:53 +00:00
// application desc
echo '<tr valign=top><td class=color0><b>Application Description</b></td>' , " \n " ;
2005-06-23 00:10:03 +00:00
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor" name="applicationDescription">' . $oApp -> sDescription . '</textarea></p></td></tr>' , " \n " ;
2005-06-12 18:48:53 +00:00
// version name
echo '<tr valign=top><td class="color0"><b>Version name</b></td>' , " \n " ;
echo '<td><input type=text name="versionName" value="' . $oVersion -> sName . '" size="20"></td></tr>' , " \n " ;
// version description
echo '<tr valign=top><td class=color0><b>Version Description</b></td>' , " \n " ;
2005-06-23 00:10:03 +00:00
echo '<td><p style="width:700px"><textarea cols="80" rows="20" id="editor2" name="versionDescription">' . $oVersion -> sDescription . '</textarea></p></td></tr>' , " \n " ;
2005-06-12 18:48:53 +00:00
2004-10-12 21:11:59 +00:00
2005-02-07 23:21:33 +00:00
echo '<tr valign=top><td class="color0"><b>email Text</b></td>' , " \n " ;
2005-02-27 16:45:49 +00:00
echo '<td><textarea name="replyText" rows=10 cols=35></textarea></td></tr>' , " \n " ;
2005-02-07 23:21:33 +00:00
echo '<tr valign=top><td class=color3 align=center colspan=2>' , " \n " ;
echo '<input type="hidden" name="appId" value="' . $oApp -> iAppId . '" />' ;
echo '<input type=submit value=" Submit App Into Database " class=button> ' , " \n " ;
2005-06-12 18:48:53 +00:00
echo '<input name="sub" type="submit" value="Delete" class="button" />' , " \n " ;
echo '</td></tr>' , " \n " ;
2005-02-09 02:17:31 +00:00
echo '</table></form>' , " \n " ;
2004-11-09 22:34:49 +00:00
}
2004-10-12 21:11:59 +00:00
echo html_frame_end ( " " );
echo html_back_link ( 1 , 'adminAppQueue.php' );
2004-03-15 16:22:00 +00:00
}
2005-02-07 23:21:33 +00:00
else if ( $_REQUEST [ 'sub' ] == 'add' )
2004-03-15 16:22:00 +00:00
{
2005-02-09 02:17:31 +00:00
if ( is_numeric ( $_REQUEST [ 'appId' ]) && ! is_numeric ( $_REQUEST [ 'versionId' ])) // application
2004-10-12 21:11:59 +00:00
{
2005-02-07 23:21:33 +00:00
// add new vendor
if ( $sVendor )
2004-10-12 21:11:59 +00:00
{
2005-02-07 23:21:33 +00:00
$oVendor = new Vendor ();
$oVendor -> create ( $sVendor );
2004-10-12 21:11:59 +00:00
}
2005-02-07 23:21:33 +00:00
$oApp = new Application ( $_REQUEST [ 'appId' ]);
2005-06-12 18:48:53 +00:00
$oApp -> update ( $_REQUEST [ 'appName' ], $_REQUEST [ 'applicationDescription' ], $_REQUEST [ 'keywords' ], $_REQUEST [ 'webpage' ], $_REQUEST [ 'vendorId' ], $_REQUEST [ 'catId' ]);
2005-02-07 23:21:33 +00:00
$oApp -> unQueue ();
2005-02-09 02:17:31 +00:00
} else if ( is_numeric ( $_REQUEST [ 'versionId' ]) && is_numeric ( $_REQUEST [ 'appId' ])) // version
2005-02-02 04:11:41 +00:00
{
2005-02-07 23:21:33 +00:00
$oVersion = new Version ( $_REQUEST [ 'versionId' ]);
2005-02-09 02:17:31 +00:00
$oVersion -> update ( $_REQUEST [ 'versionName' ], $_REQUEST [ 'versionDescription' ], null , null , $_REQUEST [ 'appId' ]);
2005-02-07 23:21:33 +00:00
$oVersion -> unQueue ();
2005-02-02 04:11:41 +00:00
}
2005-02-07 23:21:33 +00:00
2004-11-17 23:04:43 +00:00
redirect ( apidb_fullurl ( " admin/adminAppQueue.php " ));
}
2005-06-12 18:48:53 +00:00
else if ( $_REQUEST [ 'sub' ] == 'duplicate' )
{
if ( is_numeric ( $_REQUEST [ 'appIdMergeTo' ]))
{
/* move this version submission under the existing app */
$oVersion -> update ( null , null , null , null , $_REQUEST [ 'appIdMergeTo' ]);
/* delete the appId that is the duplicate */
$oApp -> delete ();
}
/* redirect back to the main page */
redirect ( apidb_fullurl ( " admin/adminAppQueue.php " ));
}
2005-02-07 23:21:33 +00:00
else if ( $_REQUEST [ 'sub' ] == 'Delete' )
2004-11-17 23:04:43 +00:00
{
2005-02-27 16:45:49 +00:00
if ( is_numeric ( $_REQUEST [ 'appId' ]) && ! is_numeric ( $_REQUEST [ 'versionId' ])) // application
2004-11-17 23:04:43 +00:00
{
2005-05-07 04:14:19 +00:00
// get the queued versions that refers to the application entry we just removed
// and delete them as we implicitly added a version entry when adding a new application
$sQuery = " SELECT versionId FROM appVersion WHERE appVersion.appId = ' " . $_REQUEST [ 'appId' ] . " ' AND appVersion.queued = 'true'; " ;
$hResult = query_appdb ( $sQuery );
if ( $hResult )
{
while ( $oRow = mysql_fetch_object ( $hResult ))
{
$oVersion = new Version ( $oRow -> versionId );
$oVersion -> delete ();
}
}
2005-06-30 22:51:28 +00:00
// delete the application entry
$oApp = new Application ( $_REQUEST [ 'appId' ]);
$oApp -> delete ();
2005-02-07 23:21:33 +00:00
} else if ( is_numeric ( $_REQUEST [ 'versionId' ])) // version
{
$oVersion = new Version ( $_REQUEST [ 'versionId' ]);
$oVersion -> delete ();
2004-10-12 21:11:59 +00:00
}
2005-02-07 23:21:33 +00:00
redirect ( apidb_fullurl ( " admin/adminAppQueue.php " ));
2004-03-15 16:22:00 +00:00
}
else
{
//error no sub!
2004-11-17 23:04:43 +00:00
addmsg ( " Internal Routine Not Found!! " , " red " );
redirect ( apidb_fullurl ( " admin/adminAppQueue.php " ));
2004-03-15 16:22:00 +00:00
}
}
2005-06-12 18:48:53 +00:00
else /* if ($_REQUEST['sub']) is not defined, display the main app queue page */
2004-03-15 16:22:00 +00:00
{
2004-11-17 23:04:43 +00:00
apidb_header ( " Admin App Queue " );
2005-02-07 23:21:33 +00:00
// get queued apps
$sQuery = " SELECT appId FROM appFamily WHERE queued = 'true' " ;
$hResult = query_appdb ( $sQuery );
2004-11-17 23:04:43 +00:00
2005-02-07 23:21:33 +00:00
if ( ! $hResult || ! mysql_num_rows ( $hResult ))
2004-03-15 16:22:00 +00:00
{
//no apps in queue
2005-02-07 23:21:33 +00:00
echo html_frame_start ( " Application Queue " , " 90% " );
2004-10-12 21:11:59 +00:00
echo '<p><b>The Application Queue is empty.</b></p>' , " \n " ;
echo html_frame_end ( " " );
2004-03-15 16:22:00 +00:00
}
else
{
//help
2004-10-12 21:11:59 +00:00
echo " <div align=center><table width='90%' border=0 cellpadding=3 cellspacing=0><tr><td> \n \n " ;
2005-02-07 23:21:33 +00:00
echo " <p>This is the list of applications waiting for your approval, or to be rejected.</p> \n " ;
2004-11-17 23:04:43 +00:00
echo " <p>To view a submission, click on its name. From that page you can edit, delete or approve it into \n " ;
echo " the AppDB .<br> \n " ;
2004-10-12 21:11:59 +00:00
echo " </td></tr></table></div> \n \n " ;
2004-03-15 16:22:00 +00:00
//show applist
2004-10-12 21:11:59 +00:00
echo html_frame_start ( " " , " 90% " , " " , 0 );
2005-02-07 23:21:33 +00:00
echo " <table width= \" 100% \" border= \" 0 \" cellpadding= \" 3 \" cellspacing= \" 0 \" >
< tr class = color4 >
< td > Submission Date </ td >
< td > Submitter </ td >
2005-02-09 02:22:20 +00:00
< td > Vendor </ td >
< td > Application </ td >
< td align = \ " center \" >Action</td>
2005-02-07 23:21:33 +00:00
</ tr > " ;
2004-10-12 21:11:59 +00:00
$c = 1 ;
2005-02-07 23:21:33 +00:00
while ( $oRow = mysql_fetch_object ( $hResult ))
2004-03-15 16:22:00 +00:00
{
2005-02-07 23:21:33 +00:00
$oApp = new Application ( $oRow -> appId );
$oSubmitter = new User ( $oApp -> iSubmitterId );
if ( $oApp -> iVendorId )
2004-11-09 22:34:49 +00:00
{
2005-02-07 23:21:33 +00:00
$oVendor = new Vendor ( $oApp -> iVendorId );
$sVendor = $oVendor -> sName ;
2004-11-09 22:34:49 +00:00
} else
{
2005-02-07 23:21:33 +00:00
$sVendor = get_vendor_from_keywords ( $oApp -> sKeywords );
2004-11-09 22:34:49 +00:00
}
2005-02-07 23:21:33 +00:00
if ( $c % 2 == 1 ) { $bgcolor = 'color0' ; } else { $bgcolor = 'color1' ; }
echo " <tr class= \" $bgcolor\ " > \n " ;
2005-02-20 01:55:53 +00:00
echo " <td> " . print_date ( mysqltimestamp_to_unixtimestamp ( $oApp -> sSubmitTime )) . " </td> \n " ;
echo " <td> \n " ;
2005-05-21 03:08:21 +00:00
echo $oSubmitter -> sEmail ? " <a href= \" mailto: " . $oSubmitter -> sEmail . " \" > " : " " ;
2005-02-20 01:55:53 +00:00
echo $oSubmitter -> sRealname ;
echo $oSubmitter -> sEmail ? " </a> " : " " ;
echo " </td> \n " ;
2005-02-09 02:22:20 +00:00
echo " <td> " . $sVendor . " </td> \n " ;
echo " <td> " . $oApp -> sName . " </td> \n " ;
echo " <td align= \" center \" >[<a href= \" adminAppQueue.php?sub=view&appId= " . $oApp -> iAppId . " \" >process</a>]</td> \n " ;
2005-02-07 23:21:33 +00:00
echo " </tr> \n \n " ;
$c ++ ;
}
echo " </table> \n \n " ;
echo html_frame_end ( " " );
}
// get queued versions (only versions where application are not queued already)
$sQuery = " SELECT versionId FROM appVersion, appFamily WHERE appFamily.appId = appVersion.appId and appFamily.queued = 'false' AND appVersion.queued = 'true' " ;
$hResult = query_appdb ( $sQuery );
if ( ! $hResult || ! mysql_num_rows ( $hResult ))
{
//no apps in queue
echo html_frame_start ( " Version Queue " , " 90% " );
echo '<p><b>The Version Queue is empty.</b></p>' , " \n " ;
echo html_frame_end ( " " );
}
else
{
//help
echo " <div align=center><table width='90%' border=0 cellpadding=3 cellspacing=0><tr><td> \n \n " ;
echo " <p>This is the list of versions waiting for your approval, or to be rejected.</p> \n " ;
echo " <p>To view a submission, click on its name. From that page you can edit, delete or approve it into \n " ;
echo " the AppDB .<br> \n " ;
echo " <p>Note that versions linked to application that have not been yet approved are not displayed in this list.</p> \n " ;
echo " the AppDB.<br> \n " ;
echo " </td></tr></table></div> \n \n " ;
//show applist
echo html_frame_start ( " " , " 90% " , " " , 0 );
echo " <table width= \" 100% \" border= \" 0 \" cellpadding= \" 3 \" cellspacing= \" 0 \" >
< tr class = color4 >
< td > Submission Date </ td >
< td > Submitter </ td >
2005-02-09 02:22:20 +00:00
< td > Vendor </ td >
< td > Application </ td >
< td > Version </ td >
< td align = \ " center \" >Action</td>
2005-02-07 23:21:33 +00:00
</ tr > " ;
$c = 1 ;
while ( $oRow = mysql_fetch_object ( $hResult ))
{
$oVersion = new Version ( $oRow -> versionId );
$oApp = new Application ( $oVersion -> iAppId );
$oSubmitter = new User ( $oVersion -> iSubmitterId );
$oVendor = new Vendor ( $oApp -> iVendorId );
$sVendor = $oVendor -> sName ;
if ( $c % 2 == 1 ) { $bgcolor = 'color0' ; } else { $bgcolor = 'color1' ; }
echo " <tr class= \" $bgcolor\ " > \n " ;
2005-06-04 00:04:36 +00:00
echo " <td> " . print_date ( mysqltimestamp_to_unixtimestamp ( $oVersion -> sSubmitTime )) . " </td> \n " ;
2005-02-20 01:55:53 +00:00
echo " <td> \n " ;
2005-05-21 03:08:21 +00:00
echo $oSubmitter -> sEmail ? " <a href= \" mailto: " . $oSubmitter -> sEmail . " \" > " : " " ;
2005-02-20 01:55:53 +00:00
echo $oSubmitter -> sRealname ;
echo $oSubmitter -> sEmail ? " </a> " : " " ;
echo " </td> \n " ;
2005-02-09 02:22:20 +00:00
echo " <td> " . $sVendor . " </td> \n " ;
echo " <td> " . $oApp -> sName . " </td> \n " ;
echo " <td> " . $oVersion -> sName . " </td> \n " ;
echo " <td align= \" center \" >[<a href= \" adminAppQueue.php?sub=view&versionId= " . $oVersion -> iVersionId . " \" >process</a>]</td> \n " ;
2004-10-12 21:11:59 +00:00
echo " </tr> \n \n " ;
$c ++ ;
}
echo " </table> \n \n " ;
echo html_frame_end ( " " );
2004-11-17 23:04:43 +00:00
2004-03-15 16:22:00 +00:00
}
}
2005-02-07 23:21:33 +00:00
apidb_footer ();
2004-03-15 16:22:00 +00:00
?>