NULL, "ext_consortium_id" => $PENDING_CONSORTIUM_ID); $columns=array('site_id','name','enabled','date_created'); $sites = $api->GetSites( $filter, $columns); if (empty($sites)) { print("
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) { $sites = $api->GetSites( array(intval($site_id)) ); if (empty($sites)) { print("Invalid request with site_id=$site_id
"); return; } $site = $sites[0]; 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)) { 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']; } # 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", "title", "email" , "phone") ); } $tech = Null; $pi = Null; foreach($persons as $person) { if ( in_array('20', $person['role_ids']) ) { $pi = $person; } if ( in_array('40', $person['role_ids']) ) { $tech = $person; } } $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.