ckp
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 12 Mar 2009 18:47:37 +0000 (18:47 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 12 Mar 2009 18:47:37 +0000 (18:47 +0000)
planetlab/common/actions.php
planetlab/slices/slice.php
plekit/niftycorner/nifty_init.js

index 718e67f..6105b1b 100644 (file)
@@ -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;
  }
 
index e90cfa4..762d7c2 100644 (file)
@@ -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();
index b927d9e..114bbb9 100644 (file)
@@ -16,10 +16,8 @@ function nifty_init () {
   for (var i=0; i<elements.length; i++) {
     // somehow we catch something with an empty id
     id = elements[i].id;
-    if (id) {
-      window.console.log('nifty initing id [' + id + ']');
+    if (id) 
       Nifty('div#'+id,'medium');
-    }
   }
   nifty_inited = true;
 }