Index: /elgg/trunk/mod/projects/lib/function_pending.php
===================================================================
--- /elgg/trunk/mod/projects/lib/function_pending.php (revision 143)
+++ /elgg/trunk/mod/projects/lib/function_pending.php (revision 143)
@@ -0,0 +1,42 @@
+mp_connectionstring)
+ or die('Could not connect: ' . pg_last_error());
+
+// Performing SQL query
+$owner_query = "SELECT P.id, P.name, P.description, U.username FROM project_request_project P, auth_user AS U WHERE status='R' AND U.id=P.owner_id";
+$result = pg_query($owner_query) or die('Query failed: ' . pg_last_error());
+
+$run_result .= '
Pending Project Requests
';
+
+if(pg_num_rows($result) < 1){
+ $run_result .= "No pending projects.";
+
+}else{
+ // Printing results in HTML
+ $run_result .= "\n";
+ while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
+ $projectname = $line['name'];
+ $pid = $line['id'];
+ $description = $line['description'];
+ $owner = $line['username'];
+ $ownerlink = "$CFG->wwwroot/$owner/";
+ $approvallink = "$CFG->wwwroot../request/$pid/approve/";
+ $run_result .= "- $projectname:
$description
Owner: $owner
Approve\n";
+ }
+ $run_result .= "
\n";
+}
+
+// Free resultset
+pg_free_result($result);
+
+// Closing connection
+pg_close($dbconn);
+
+
+
+
+?>
Index: /elgg/trunk/mod/projects/pending.php
===================================================================
--- /elgg/trunk/mod/projects/pending.php (revision 143)
+++ /elgg/trunk/mod/projects/pending.php (revision 143)
@@ -0,0 +1,25 @@
+
Index: /elgg/trunk/mod/projects/lib.php
===================================================================
--- /elgg/trunk/mod/projects/lib.php (revision 88)
+++ /elgg/trunk/mod/projects/lib.php (revision 143)
@@ -7,4 +7,5 @@
$function['projects:browse'][] = dirname(__FILE__) . '/lib/function_browse.php';
$function['projects:graveyard'][] = dirname(__FILE__) . '/lib/function_graveyard.php';
+ $function['projects:pending'][] = dirname(__FILE__) . '/lib/function_pending.php';
// $PAGE->search_menu[] = array( 'name' => __gettext("Projects"), 'user_type' => 'projects');
@@ -60,5 +61,9 @@
'name' => 'projects:projectgraveyard',
'html' => '' . __gettext("Project Graveyard") . '');
-
+ if(isloggedin() && user_flag_get("admin", $_SESSION['userid'])){
+ $PAGE->menu_sub[] = array (
+ 'name' => 'projects:pendingprojects',
+ 'html' => '' . __gettext("Pending Project Requests") . '');
+ }//end admin if
}//end context if