X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fsites%2Fjoin_request.php;h=f0b5562f045ee212bc48f06d8f520dfb71c3838e;hb=9b8b74f6feeb99e0222717f0e1ed2f6e51f7b55b;hp=cb70109a1d8251dfccf1ef0352b130fb63f56875;hpb=9c2c95763677a4f5045bc039f680e56752861f4b;p=plewww.git diff --git a/planetlab/sites/join_request.php b/planetlab/sites/join_request.php index cb70109..f0b5562 100644 --- a/planetlab/sites/join_request.php +++ b/planetlab/sites/join_request.php @@ -9,33 +9,57 @@ require_once 'plc_login.php'; // Get session and API handles require_once 'plc_session.php'; -global $plc, $api; - -// Common functions -require_once 'plc_functions.php'; -require_once 'plc_sorts.php'; +require_once 'plc_api.php'; +global $plc, $api, $adm; // Print header require_once 'plc_drupal.php'; include 'plc_header.php'; +// Common functions +require_once 'plc_functions.php'; +require_once 'details.php'; +require_once 'nifty.php'; +require_once 'table.php'; +require_once 'nifty.php'; + include 'site_form.php'; //////////////////////////////////////// function render_all_join_requests($api) { - $sites = $api->GetSites( array("enabled" => False, "peer_id" => NULL)); - if (!empty($sites)) { - print("
Site Name | site_id | Submitted |
---|---|---|
%s | ", $site['site_id'], $site['name']); - printf("%d | ", $site['site_id'], $site['site_id']); - printf("%s |
No open join requests
"); + return; } + $headers = array(); + $headers['id']='int'; + $headers['Site Name']='string'; + # trying the sortEnglishDateTime stuff - not too lucky so far + # http://www.frequency-decoder.com/demo/table-sort-revisited/custom-sort-functions/ + $headers['submitted']='sortEnglishDateTime'; + $headers['enabled']='string'; + + $nifty=new PlekitNifty ('pending','sites-pending','medium'); + $nifty->start(); + $table=new PlekitTable ('pending',$headers,2, + array('pagesize_area'=>FALSE,'pagesize'=>10000)); + $table->start(); + foreach($sites as $site) { + $site_id=$site['site_id']; + $link = $site['enabled'] ? l_site($site_id) : l_site_review_pending($site_id); + $table->row_start(); + $table->cell(href($link,$site['site_id'])); + $table->cell(href($link,$site['name'])); + $table->cell(date("dS F Y",$site['date_created']) . " at " . date("G:i",$site['date_created'])); + $table->cell( $site['enabled'] ? plc_warning_html('yes') : 'no'); + $table->row_end(); + } + $table->end(); + $nifty->end(); } function render_join_request_review($api, $site_id) { @@ -45,23 +69,25 @@ function render_join_request_review($api, $site_id) { return; } $site = $sites[0]; - if ($site['enabled']) { + if ($site['enabled'] && $site['ext_consortium_id'] === $PENDING_CONSORTIUM_ID) { print("This site is already enabled
"); return; } $addresses = $api->GetAddresses ($site['address_ids']); if (empty ($addresses)) { - print("No address found for site_id=$site_id
"); - return ; + drupal_set_message("Site $site_id has no address - never mind"); + $address=array('line1'=>''); + $address_id=0; + } else { + $address = $addresses[0]; + $address_id=$address['address_id']; } - $address = $addresses[0]; - $address_id=$address['address_id']; # just in case there is no person attached yet if (empty ($site['person_ids'])) { $persons=array(); } else { $person_ids = $site['person_ids']; - $persons = $api->GetPersons( $person_ids, array( "person_id", "role_ids", "first_name", "last_name", "email" , "phone") ); + $persons = $api->GetPersons( $person_ids, array( "person_id", "role_ids", "first_name", "last_name", "title", "email" , "phone") ); } $tech = Null; $pi = Null; @@ -75,7 +101,7 @@ function render_join_request_review($api, $site_id) { } $pi_id = $pi['person_id']; $tech_id = $tech['person_id']; - + print <<< EOFPlease review the join request below.
Warning: the PI email address that was provided in this form will not be checked automatically. We expect that as part of the handshake with the site, the support team has had an opportunity to use this address so it can be considered safe. Please check it manually if this is not the case.
@@ -84,41 +110,37 @@ function render_join_request_review($api, $site_id) { - -
+ $buttons_row =<<
|
|
| |
- | - | - |