git://git.onelab.eu
/
plewww.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9c6157d
)
checkpoint
author
Thierry Parmentelat
<thierry.parmentelat@sophia.inria.fr>
Tue, 27 Jan 2009 13:59:33 +0000
(13:59 +0000)
committer
Thierry Parmentelat
<thierry.parmentelat@sophia.inria.fr>
Tue, 27 Jan 2009 13:59:33 +0000
(13:59 +0000)
planetlab/css/plc_tables.css
patch
|
blob
|
history
planetlab/includes/plc_minitabs.php
patch
|
blob
|
history
planetlab/persons/person.php
patch
|
blob
|
history
planetlab/persons/person_actions.php
patch
|
blob
|
history
planetlab/persons/persons.php
patch
|
blob
|
history
diff --git
a/planetlab/css/plc_tables.css
b/planetlab/css/plc_tables.css
index
1a03646
..
b5cc03b
100644
(file)
--- a/
planetlab/css/plc_tables.css
+++ b/
planetlab/css/plc_tables.css
@@
-66,18
+66,18
@@
tr.alt {
/* Poor old Internet Explorer 6 has a bug that means we can't use background images for the table rows
as it trys to download the image each and every time that it is used (which means a 1000 row table
will produce 1000 http requests for the image in question) */
/* Poor old Internet Explorer 6 has a bug that means we can't use background images for the table rows
as it trys to download the image each and every time that it is used (which means a 1000 row table
will produce 1000 http requests for the image in question) */
-tr[class="alt"]
td {
+tr[class="alt"]
>
td {
background: #F5FAFA url(/planetlab/icons/tablesort_td_alt.jpg) no-repeat;
}
td.plc_table [class~="alt"] {
background: #edf3f3 url(/planetlab/icons/tablesort_col_alt.jpg) no-repeat !important;
}
/* Poor old Internet Explorer won't see the next two rules either as it doesn't get :first-child */
background: #F5FAFA url(/planetlab/icons/tablesort_td_alt.jpg) no-repeat;
}
td.plc_table [class~="alt"] {
background: #edf3f3 url(/planetlab/icons/tablesort_col_alt.jpg) no-repeat !important;
}
/* Poor old Internet Explorer won't see the next two rules either as it doesn't get :first-child */
-table.plc_table
tbody tr.alt
td:first-child {
+table.plc_table
>tbody>tr.alt>
td:first-child {
background: #F5FAFA url(/planetlab/icons/tablesort_bullet2.gif) no-repeat;
font-weight:bold;
}
background: #F5FAFA url(/planetlab/icons/tablesort_bullet2.gif) no-repeat;
font-weight:bold;
}
-table.plc_table
tbody tr
td:first-child {
+table.plc_table
>tbody>tr>
td:first-child {
background: #fff url(/planetlab/icons/tablesort_bullet1.gif) no-repeat;
font-weight:bold;
}
background: #fff url(/planetlab/icons/tablesort_bullet1.gif) no-repeat;
font-weight:bold;
}
diff --git
a/planetlab/includes/plc_minitabs.php
b/planetlab/includes/plc_minitabs.php
index
0574f6b
..
ae7c323
100644
(file)
--- a/
planetlab/includes/plc_minitabs.php
+++ b/
planetlab/includes/plc_minitabs.php
@@
-57,7
+57,9
@@
function plc_tabs($array) {
$type='type=button value="' . $label . '"';
}
printf('<span title="%s">',$todo['bubble']);
$type='type=button value="' . $label . '"';
}
printf('<span title="%s">',$todo['bubble']);
- printf('<input %s %s onclick=\'miniTab.submit("%s");\' />',$tracer,$type,$todo['confirm']);
+ $message="";
+ if ($todo['confirm']) $message=$todo['confirm'] . " ?";
+ printf('<input %s %s onclick=\'miniTab.submit("%s");\' />',$tracer,$type,$message);
printf('</span>',$todo['bubble']);
printf("</form></li>\n");
}
printf('</span>',$todo['bubble']);
printf("</form></li>\n");
}
diff --git
a/planetlab/persons/person.php
b/planetlab/persons/person.php
index
2bde056
..
25ef6cd
100644
(file)
--- a/
planetlab/persons/person.php
+++ b/
planetlab/persons/person.php
@@
-11,9
+11,7
@@
global $plc, $api;
// Print header
require_once 'plc_drupal.php';
// Print header
require_once 'plc_drupal.php';
-require_once 'plc_minitabs.php';
-require_once 'plc_tables.php';
-
+include 'plc_header.php';
// Common functions
require_once 'plc_functions.php';
// Common functions
require_once 'plc_functions.php';
@@
-69,16
+67,18
@@
if (empty($persons)) {
if ($local_peer && $privileges) {
if (plc_is_admin())
if ($local_peer && $privileges) {
if (plc_is_admin())
- $tabs['Events'] = array('url'=>l_event("Person","person",$person_id),
- 'bubble'=>'Related events',
- 'image'=>'/planetlab/icons/event.png',
- 'height'=>18);
+ $tabs['Events'] = array('url'=>l_events(),
+ 'values'=>array('type'=>'Person','person'=>$person_id),
+ 'bubble'=>'Related events',
+ 'image'=>'/planetlab/icons/event.png',
+ 'height'=>18);
if ($enabled)
$tabs['Disable'] = array ('method'=>'POST',
'url'=>'/db/persons/person_actions.php',
'values'=> array ('person_id'=>$person_id,
'action'=>'disable'),
if ($enabled)
$tabs['Disable'] = array ('method'=>'POST',
'url'=>'/db/persons/person_actions.php',
'values'=> array ('person_id'=>$person_id,
'action'=>'disable'),
- 'bubble'=>"Disable $first_name");
+ 'bubble'=>"Disable $first_name",
+ 'confirm'=>"Are you sure you want to disable $first_name $last_name");
else
$tabs['Enable'] = array ('method'=>'POST',
'url'=>'/db/persons/person_actions.php',
else
$tabs['Enable'] = array ('method'=>'POST',
'url'=>'/db/persons/person_actions.php',
@@
-98,7
+98,7
@@
if (empty($persons)) {
'values'=>array('id'=>$person_id),
'bubble'=>"Update $first_name");
'values'=>array('id'=>$person_id),
'bubble'=>"Update $first_name");
- $tabs['
Person
s'] = array ('url'=>l_persons());
+ $tabs['
All User
s'] = array ('url'=>l_persons());
plc_tabs($tabs);
plc_tabs($tabs);
diff --git
a/planetlab/persons/person_actions.php
b/planetlab/persons/person_actions.php
index
155c1bd
..
9dbcd34
100644
(file)
--- a/
planetlab/persons/person_actions.php
+++ b/
planetlab/persons/person_actions.php
@@
-21,13
+21,13
@@
require_once 'plc_sorts.php';
$_person= $plc->person;
$_roles= $_person['role_ids'];
$_person= $plc->person;
$_roles= $_person['role_ids'];
-
+//////////////////////////////
// get person id
if( $_POST['person_id'] )
$person_id= $_POST['person_id'];
// get person id
if( $_POST['person_id'] )
$person_id= $_POST['person_id'];
-//
if site_id submitted add the person to that site_id
+//
////////////////// add in site
if( $_POST['site_add'] ) {
$site_id= $_POST['site_add'];
if( $_POST['site_add'] ) {
$site_id= $_POST['site_add'];
@@
-37,6
+37,7
@@
if( $_POST['site_add'] ) {
}
}
+//////////////////// remove from sites
if ( $_POST['Remove_Sites']){
if( $_POST['rem_site'] ) {
foreach( $_POST['rem_site'] as $site_id ) {
if ( $_POST['Remove_Sites']){
if( $_POST['rem_site'] ) {
foreach( $_POST['rem_site'] as $site_id ) {
@@
-47,9
+48,11
@@
if ( $_POST['Remove_Sites']){
}else{
echo "<h3><span class='plc-warning'>Please select one or more Sites to remove.<br /></h3> </span>\n";
echo "<br /><hr /><p><a href='/db/persons/index.php?id=$person_id'>Back to person page</a></div>";
}else{
echo "<h3><span class='plc-warning'>Please select one or more Sites to remove.<br /></h3> </span>\n";
echo "<br /><hr /><p><a href='/db/persons/index.php?id=$person_id'>Back to person page</a></div>";
+ return;
}
}
}
}
+//////////////////// remove roles
// remove role
if ( $_POST['Remove_Roles']){
if($_POST['rem_role']) {
// remove role
if ( $_POST['Remove_Roles']){
if($_POST['rem_role']) {
@@
-65,7
+68,7
@@
if ( $_POST['Remove_Roles']){
}
}
}
}
-// add roles
+//
//////////////////
add roles
if( $_POST['add_role'] ) {
$role_id= $_POST['add_role'];
if( $_POST['add_role'] ) {
$role_id= $_POST['add_role'];
@@
-75,8
+78,9
@@
if( $_POST['add_role'] ) {
exit();
}
exit();
}
+//////////////////// enable
// enable person
// enable person
-if( $_GET['enab_id'] ) {
+if
( $_GET['enab_id'] ) {
$per_id= $_GET['enab_id'];
$fields= array( "enabled"=>true );
$per_id= $_GET['enab_id'];
$fields= array( "enabled"=>true );
@@
-88,7
+92,7
@@
if( $_GET['enab_id'] ) {
}
}
-// disable person
+//
//////////////////
disable person
if( $_GET['dis_id'] ) {
$per_id= $_GET['dis_id'];
if( $_GET['dis_id'] ) {
$per_id= $_GET['dis_id'];
@@
-96,7
+100,7
@@
if( $_GET['dis_id'] ) {
$api->UpdatePerson( intval( $per_id ), $fields );
$api->UpdatePerson( intval( $per_id ), $fields );
- header( "location: index.php?id=$per
son
_id" );
+ header( "location: index.php?id=$per_id" );
exit();
}
exit();
}
@@
-127,11
+131,11
@@
if( $_POST['action'] ) {
}
}
-// delete person
+//
//////////////////
delete person
if( $_GET['per_id'] ) {
if( $_GET['per_id'] ) {
- $per
son
_id= $_GET['per_id'];
+ $per_id= $_GET['per_id'];
- $api->DeletePerson( intval( $per
son
_id ) );
+ $api->DeletePerson( intval( $per_id ) );
header( "location: index.php" );
exit();
header( "location: index.php" );
exit();
diff --git
a/planetlab/persons/persons.php
b/planetlab/persons/persons.php
index
f7eb758
..
dc8fbb5
100644
(file)
--- a/
planetlab/persons/persons.php
+++ b/
planetlab/persons/persons.php
@@
-64,7
+64,7
@@
function person_status ($person) {
// fetch persons
// fetch persons
-$person_columns=array('first_name','last_name','email','roles','peer_id','key_ids','site_ids');
+$person_columns=array('
person_id','
first_name','last_name','email','roles','peer_id','key_ids','site_ids');
// PIs and admins can see users not yet enabled
$privileges=plc_is_admin() || plc_is_pi();
if ( ! $privileges )
// PIs and admins can see users not yet enabled
$privileges=plc_is_admin() || plc_is_pi();
if ( ! $privileges )
@@
-89,6
+89,8
@@
if ($site_id) {
$title .= t_site($site);
$tabs = array_merge($tabs,tabs_site($site));
$person_filter['person_id']=$site['person_ids'];
$title .= t_site($site);
$tabs = array_merge($tabs,tabs_site($site));
$person_filter['person_id']=$site['person_ids'];
+ if ($site_id == plc_my_site_id())
+ unset($tabs['My accounts']);
}
if ($slice_id) {
}
if ($slice_id) {
@@
-140,7
+142,7
@@
$columns = array ("Peer"=>"string",
// initial sort on email
$table_options=array();
// initial sort on email
$table_options=array();
-plc_table_start("persons",$columns,
5
,$table_options);
+plc_table_start("persons",$columns,
4
,$table_options);
$peer_hash = plc_peer_get_hash ($api);
// write rows
$peer_hash = plc_peer_get_hash ($api);
// write rows