Subversion Repositories PEEPS

Rev

Rev 47 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 47 Rev 50
Line 140... Line 140...
140
push @leagueroles, map { $h->div ({ class=>"rTableRow shaded" },
140
push @leagueroles, map { $h->div ({ class=>"rTableRow shaded" },
141
                         [ $h->div ({ class=>"rTableCellr".($_->[1] eq "Pending" ? " highlighted" : ""), style=>"font-size: smaller;".($_->[1] eq "Pending" ? " font-style: italic;" : "") },
141
                         [ $h->div ({ class=>"rTableCellr".($_->[1] eq "Pending" ? " highlighted" : ""), style=>"font-size: smaller;".($_->[1] eq "Pending" ? " font-style: italic;" : "") },
142
                           $_->[1], [ $h->input ({type=>"submit", name=>"Delete", value=>"Delete", onClick=>"this.value=$_->[0]"}) ] ) ]) } @roles; # Change button -> , $h->input ({type=>"submit", name=>"Change", value=>"Change", onClick=>"this.value=$_->[0]"})
142
                           $_->[1], [ $h->input ({type=>"submit", name=>"Delete", value=>"Delete", onClick=>"this.value=$_->[0]"}) ] ) ]) } @roles; # Change button -> , $h->input ({type=>"submit", name=>"Change", value=>"Change", onClick=>"this.value=$_->[0]"})
Line 143... Line 143...
143
 
143
 
144
if (WebDB::trim scalar param ("Add")) {
144
if (WebDB::trim scalar param ("Add")) {
145
#  use tableViewer qw(notInArray);
145
  use tableViewer;
146
  my @allowed_roles = grep { tableViewer::notInArray ($_, [map { $_->[1] } @roles]) } grep { $_ ne "System Admin" unless $league_name eq "WFTDA Leadership" } grep { $_ ne "Pending" } map { $_->[0] } @{ $dbh->selectall_arrayref ("select distinct role from user_roles where visible = ? order by role", undef, 1) };
146
  my @allowed_roles = grep { notInArray ($_, [map { $_->[1] } @roles]) } grep { $_ ne "System Admin" unless $league_name eq "WFTDA Leadership" } grep { $_ ne "Pending" } map { $_->[0] } @{ $dbh->selectall_arrayref ("select distinct role from user_roles where visible = ? order by role", undef, 1) };
147
  push @leagueroles, $h->div ({ class=>"rTableRow shaded" },
147
  push @leagueroles, $h->div ({ class=>"rTableRow shaded" },
148
                       [ $h->div ({ class=>"rTableCellr"}, $h->select ({name=>"newrole"}, [ map { $h->option ($_) } @allowed_roles ]), $h->input ({type=>"submit", name=>"savenewrole", value=>"Save"}).' '.$h->button ("Cancel")) ]);
148
                       [ $h->div ({ class=>"rTableCellr"}, $h->select ({name=>"newrole"}, [ map { $h->option ($_) } @allowed_roles ]), $h->input ({type=>"submit", name=>"savenewrole", value=>"Save"}).' '.$h->button ("Cancel")) ]);
Line 149... Line 149...
149
}
149
}
Line 150... Line 150...
150
 
150
 
151
print $h->ul ([@leagueroles]);
151
print $h->ul ([@leagueroles]);
152
 
152
 
Line 153... Line 153...
153
#use tableViewer qw(inArray);
153
use tableViewer;
Line 154... Line 154...
154
if (tableViewer::inArray ("Pending", [values %rolename])) {
154
if (inArray ("Pending", [values %rolename])) {