From: Thierry Parmentelat Date: Thu, 12 Mar 2009 18:47:37 +0000 (+0000) Subject: ckp X-Git-Tag: PLEWWW-4.3-1~21 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6e65d515493f52c0a7a71a78c4a992d93d3ebea0;hp=c8011af627265e7e3faca9065271d98590212f7b;p=plewww.git ckp --- diff --git a/planetlab/common/actions.php b/planetlab/common/actions.php index 718e67f..6105b1b 100644 --- a/planetlab/common/actions.php +++ b/planetlab/common/actions.php @@ -494,7 +494,7 @@ switch ($action) { drupal_set_message ("Deleted $counter person(s)"); else drupal_set_error ("Could not delete all selected persons, only $counter were removed"); - plc_redirect(l_slice($slice_id)); + plc_redirect(l_slice($slice_id) . " &show_users=true"); break; } @@ -504,7 +504,7 @@ switch ($action) { $success=true; $counter=0; - foreach( $person_ids as $person_id ) { + foreach ($person_ids as $person_id) { if ($api->AddPersonToSlice(intval($person_id),$slice_id) != 1) $success=false; else @@ -514,7 +514,7 @@ switch ($action) { drupal_set_message ("Added $counter person(s)"); else drupal_set_error ("Could not add all selected persons, only $counter were added"); - plc_redirect(l_slice($slice_id)); + plc_redirect(l_slice($slice_id) . "&show_users=true" ); break; } diff --git a/planetlab/slices/slice.php b/planetlab/slices/slice.php index e90cfa4..762d7c2 100644 --- a/planetlab/slices/slice.php +++ b/planetlab/slices/slice.php @@ -246,7 +246,9 @@ $persons=$api->GetPersons(array('person_id'=>$slice['person_ids'])); // just propose to add evryone else, regular users can see only a fraction of the db anyway $potential_persons=$api->GetPersons(array('~person_id'=>$slice['person_ids'],'peer_id'=>NULL), array('email','person_id','first_name','last_name','roles')); -$toggle=new PlekitToggle ('persons',"Users",array('trigger-bubble'=>'Manage users attached to this slice','start-visible'=>false)); +$show_users=false; +if ( $_GET['show_users']) $show_users=true; +$toggle=new PlekitToggle ('persons',"Users",array('trigger-bubble'=>'Manage users attached to this slice','start-visible'=>$show_users)); $toggle->start(); ////////// people currently in @@ -295,10 +297,14 @@ if ($privileges) { $headers['R']='string'; $headers['Add']="none"; // xxx caption currently broken, messes pagination - $table=new PlekitTable('add_persons',$headers,'1',array(//'caption'=>'Users to add', - 'search_area'=>false, - 'notes_area'=>false, - 'pagesize'=>5)); + $options = array(//'caption'=>'Users to add', + 'notes_area'=>false, + 'search_width'=>15, + 'pagesize'=>8); + // show search for admins only as other people won't get that many names to add + if ( ! plc_is_admin() ) $options['search_area']=false; + + $table=new PlekitTable('add_persons',$headers,'1',$options); $form=new PlekitForm(l_actions(),array('slice_id'=>$slice['slice_id'])); $form->start(); $table->start(); diff --git a/plekit/niftycorner/nifty_init.js b/plekit/niftycorner/nifty_init.js index b927d9e..114bbb9 100644 --- a/plekit/niftycorner/nifty_init.js +++ b/plekit/niftycorner/nifty_init.js @@ -16,10 +16,8 @@ function nifty_init () { for (var i=0; i